home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / html / vendors / adobe / software / illustrator_5.5.1 / Installill2.csh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-06-17  |  103KB  |  3,311 lines

  1. #!/bin/sh
  2. # #########################################################################
  3. #
  4. # Copyright (c) 1994 Adobe System Incorporated
  5. # All Rights Reserved
  6. #
  7. #    ***********************************************************************
  8. #    If you copy this script off of the CD-ROM and then edit it, this
  9. #    script will only work if you pass it the optional parameter "CDDIR=xxx",
  10. #    where "xxx" is the mount point for the CD-ROM (e.g., /cdrom).
  11. #    ***********************************************************************
  12. #
  13. # In general, this script accepts command line parameters in the form:
  14. #    xxx=yyy
  15. # where "xxx" is a shell variable name and "yyy" is the value.
  16. # For each parameter with an equal sign, this script does an eval on the parameter.
  17. # Probably, CDDIR is the only parameter which makes sense to alter.
  18. #
  19. ##########################################################################
  20.  
  21. export PATH
  22. export HOME
  23.  
  24. ABORTCMD='${RM} $PKGLISTFILE; echo ""; echo ""; echo "*** Installation canceled ***"; echo ""; exit 1;'
  25.  
  26. # For echo without newline under BSD, set EB and EE variables
  27. EB="-n "
  28. EE=""
  29. LASTLINECMD="tail -1"
  30.  
  31. # Things that are either platform-specific or potentially platform-specific.
  32. osname="UNKNOWN"
  33. osversion="UNKNOWN"
  34. osmajorminor="UNKNOWN"
  35. osmajor="UNKNOWN"
  36. osminor="UNKNOWN"
  37. if [ -x /bin/uname ] ; then
  38.     osname=`/bin/uname -s`
  39.         # 64 bit IRIX6 returns IRIX64 for uname -s
  40.     firstfour=`echo "$osname" | sed -e 's/^\(....\).*$/\1/g'`
  41.         if [ "$firstfour" = "IRIX" ] ; then
  42.                 osname="IRIX"
  43.         fi
  44.     osversion=`/bin/uname -r`
  45.     check=`echo "$osversion" | egrep '^[0-9]\.[0-9]*'`
  46.     if [ "$check" != "" ] ; then
  47.         # osmajorminor will be like "4.2". osmajor: "4". osminor:"2".
  48.         osmajorminor=`echo "$osversion" | sed -e 's/^\([0-9]\.[0-9]\).*/\1/'`
  49.         osmajor=`echo "$osversion" | sed -e 's/^\([0-9]\).*/\1/'`
  50.         osminor=`echo "$osversion" | sed -e 's/^[0-9]\.\([0-9]\).*/\1/'`
  51.     fi
  52. fi
  53. if [ $osname = "SunOS" ] ; then
  54.     STDBINDIR="/usr/bin"
  55.     RETURNKEYNAME="Return"
  56.     if [ $osmajor -ge 5 ] ; then
  57.         DFTTAPEPATH=/dev/rmt/0
  58.         # For echo without newline under Sys V, set EB and EE variables
  59.         EB=""
  60.         EE="\c"
  61.         PATH=/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/openwin/bin:/sbin:/usr/sbin:/etc:/usr/etc
  62.         WHOAMI=`$STDBINDIR/id | $STDBINDIR/sed 's/^[^(]*.\([^)]*\).*/\1/'`
  63.         DFTDAEMONDIR=sun4/sunOS5
  64.         DFCMD="$STDBINDIR/df -k"
  65.         DUCMD="$STDBINDIR/du -sk"
  66.         DUFACTOR=1
  67.         NLINES_CMD="$STDBINDIR/wc -l"
  68.     else
  69.         DFTTAPEPATH=/dev/rst0
  70.         # For echo without newline under BSD, set EB and EE variables
  71.         EB="-n "
  72.         EE=""
  73.         PATH=/usr/ucb:/usr/bin:/bin:/usr/bin/X11:/usr/openwin/bin:/sbin:/etc:/usr/etc
  74.         WHOAMI=`/usr/ucb/whoami`
  75.         DFTDAEMONDIR=sun4/sunOS4
  76.         DFCMD="$STDBINDIR/df"
  77.         DUCMD="$STDBINDIR/du -s"
  78.         DUFACTOR=1
  79.         NLINES_CMD="/usr/ucb/wc -l"
  80.     fi
  81.     CLEAR=/usr/ucb/clear
  82.     DFTCDROMPATH=/cdrom
  83.     DFTTOPDIR=/usr/adobe
  84.     KEYSYMDBFILE=/usr/openwin/lib/XKeysymDB
  85.     KBYTES_AVAIL_FIELD=4
  86.     GETHOSTID="hostid"
  87.     RSH="/usr/ucb/rsh"
  88.  
  89. elif [ $osname = "IRIX" ] ; then
  90.     STDBINDIR="/usr/bin"
  91.     RETURNKEYNAME="Enter"
  92.     DFTTAPEPATH=/dev/tape
  93.     DFTCDROMPATH=/CDROM
  94.     DFTTOPDIR=/usr/adobe
  95.     KEYSYMDBFILE=/usr/lib/X11/XKeysymDB
  96.     DFCMD="$STDBINDIR/df -k"
  97.     DUCMD="$STDBINDIR/du -sk"
  98.     DUFACTOR=1
  99.     KBYTES_AVAIL_FIELD=5
  100.     GETHOSTID='/etc/sysinfo | /usr/bsd/head -2 | $STDBINDIR/tail -1 | $STDBINDIR/awk '\''{ printf "%s%s%s%s", $1, $2, $3, $4; }'\'
  101.     CLEAR=/usr/bsd/clear
  102.     WHOAMI=`$STDBINDIR/id | $STDBINDIR/sed 's/^[^(]*.\([^)]*\).*/\1/'`
  103.     # For echo without newline under Sys V, set EB and EE variables
  104.     EB=""
  105.     EE="\c"
  106.     PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/bsd:/usr/bin/X11:/usr/openwin/bin:/etc:/usr/etc
  107.     DFTDAEMONDIR=sgi/v5
  108.     NLINES_CMD="$STDBINDIR/wc -l"
  109.     RSH="/usr/bsd/rsh"
  110.  
  111. elif [ $osname = "HP-UX" ] ; then
  112.     STDBINDIR="/bin"
  113.     RETURNKEYNAME="Return"
  114.     DFTTAPEPATH=/dev/rmt/0m
  115.     DFTCDROMPATH=/cdrom
  116.     DFTTOPDIR=/usr/adobe
  117.     KEYSYMDBFILE=/usr/lib/X11/XKeysymDB
  118.     DFCMD="/usr/bin/bdf"
  119.     DUCMD="$STDBINDIR/du -s"
  120.     DUFACTOR=.5
  121.     KBYTES_AVAIL_FIELD=4
  122.     GETHOSTID="$STDBINDIR/uname -i"
  123.     CLEAR="/usr/bin/clear"
  124.     WHOAMI=`/usr/bin/whoami`
  125.     # For echo without newline under Sys V, set EB and EE variables
  126.     EB=""
  127.     EE="\c"
  128.     PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/bin/X11:/etc:/usr/etc
  129.     DFTDAEMONDIR="???/???"
  130.     NLINES_CMD="$STDBINDIR/wc -l"
  131.     RSH="/usr/bin/remsh"
  132. fi
  133. if [ "$osname" = "UNKNOWN" -o "$osversion" = "UNKNOWN" ] ; then
  134.     echo ""
  135.     echo "Unrecognized operating system: $osname $osversion."
  136.     echo "Cannot install: $DISTRIB_DESC"
  137.     eval ${ABORTCMD}
  138. fi
  139.  
  140. export PATH
  141.  
  142. TAR_OPTS_C="-cf"
  143. TAR_OPTS_X="-xfv"
  144. TAR="$STDBINDIR/tar"
  145. MKDIR="$STDBINDIR/mkdir -p "
  146. RMDIR="$STDBINDIR/rmdir "
  147. CP="$STDBINDIR/cp"
  148. LN="$STDBINDIR/ln -s"
  149. RM="$STDBINDIR/rm -f"
  150. MV="$STDBINDIR/mv"
  151. CAT="$STDBINDIR/cat"
  152. SED="$STDBINDIR/sed"
  153. AWK="$STDBINDIR/awk"
  154. EXPR="$STDBINDIR/expr"
  155. PWDCMD="$STDBINDIR/pwd"
  156. DIRCP="$STDBINDIR/cp -pr"
  157. DIRRM="$STDBINDIR/rm -rf"
  158. LS="$STDBINDIR/ls"
  159. # On some systems, cd is a shell intrinsic
  160. # Also, executable is not always compatible with scripts, so
  161. # just use plain "cd"
  162. CD="cd"
  163.  
  164. # Temporary directory used by this install script.
  165. if [ "$INSTALLTEMPDIR" = "" ] ; then
  166.     INSTALLTEMPDIR="/tmp"
  167. fi
  168. PKGLISTFILE=$INSTALLTEMPDIR"/Packages."$$
  169.  
  170. # Installation device (CDROM or TAPE)
  171. if [ "$INSTALLDEVICE" = "" ] ; then
  172.     INSTALLDEVICE="CDROM"
  173. fi
  174.  
  175. # Make sure we have proper access to installation temp file.
  176. if [ ! -w $INSTALLTEMPDIR ] ; then
  177.     echo "Permission denied in writing to directory $INSTALLTEMPDIR."
  178.     echo "Please change permissions and rerun this script."
  179.     echo ""
  180.     exit 1
  181. fi
  182. if [ -f $PKGLISTFILE -a ! -w $PKGLISTFILE ] ; then
  183.     echo "Permission denied in creating file $PKGLISTFILE."
  184.     echo "Please change permissions and rerun this script."
  185.     echo ""
  186.     exit 1
  187. fi
  188.  
  189. # Description of this distribution.
  190. DISTRIB_DESC="Adobe Illustrator Version 5.5.1 for SGI IRIX 5.2"
  191.  
  192. # Whether this software is protected by an electronic license (y or n).
  193. if [ "$ELECTRONIC_LICENSE" = "" ] ; then
  194.     ELECTRONIC_LICENSE="n"
  195. fi
  196.  
  197. # Name of file containing the electronic license
  198. # (relative to directory containing this install script).
  199. if [ "$ELECTRONIC_LICENSE_FILE" = "" ] ; then
  200.     ELECTRONIC_LICENSE_FILE="license"
  201. fi
  202.  
  203. # Which packages to install (prompt or ALL or list of numbers)
  204. WHICH_PACKAGES="prompt"
  205. if [ "$WHICH_PACKAGES" = "" ] ; then
  206.     WHICH_PACKAGES="prompt"
  207. fi
  208.  
  209. # Descriptions of packages included with this distribution.
  210. # NPKGS indicates how many packages are included in this distribution.
  211. # Following NPKGS is the printed table which appears to the user when
  212. # choosing which packages to install.
  213. # This table is stored in a temporary file while the install script runs.
  214. # PKG_$i_PKGFULLDESC: Full product description (version, platform included)
  215. # PKG_$i_PKGDESC: Descriptive product name
  216. # PKG_$i_VERSIONDESC: Descriptive product version
  217. # PKG_$i_PLATFORMDESC: Description of platform required to run package
  218. # PKG_$i_KBYTES: Space required for package (in kilobytes. No trailing K)
  219. # PKG_$i_PKGABBR: Abbreviated product name (no spaces or underscores)
  220. # PKG_$i_PKGVERS: Abbreviated version number (no spaces or underscores)
  221. # PKG_$i_BINLINKS: List of programs requiring auto sym links to $DFTSYMLINKDIR
  222. # PKG_$i_FONTDIR: Directory to put FONTPATTERN fonts in
  223. # PKG_$i_FONTUPR: UPR file describing FONTPATTERN fonts
  224. # PKG_$i_XKEYSYMDB: Set this to "1" if package required updates to XKeysymDB
  225. # PKG_$i_SCRIPT: Name of script to run after package is installed (or empty string)
  226. # PKG_$i_LMFEATURE: Describes components requiring a password (null string if none)
  227. # PKG_$i_LMVERSION: Corresponding FlexLM version string.
  228. # PKG_$i_LMQUOTES: Corresponding FlexLM string within quotes.
  229. # PKG_$i_CDROM_FROMFILES: Name of files on CDROM to copy into install tree.
  230. #                    Relative to dir with install script.
  231. # PKG_$i_CDROM_TOFILES: What to rename the files specified in CDROM_FROMFILES.
  232. #                    Relative to base dir for product tree.
  233. # PKG_$i_FORCED_PKGS: Numbers of other packages whose installation is forced by
  234. #                    installation of this package. Default: none.
  235. # PKG_$i_OLD_VERSION_ACTION: What to do if same package is already installed
  236. #                    in same location: "quiet:leavealone", "quiet:overwrite",
  237. #                    "prompt:oktodelete", "prompt:leavealone/overwrite".
  238. #                    Default: "prompt:oktodelete".
  239. # PKG_$i_HIDDEN: Set this to "1" if package should be hidden from user.
  240. #                    Hidden packages have to be at end of list! Default: 0.
  241. # PKG_$i_PSRES_WRITEFILE: Set to "y" if package should write out
  242. #        custom/SITE_PSRESOURCEPATH. Default: use value of PSRES_WRITEFILE.
  243. # PKG_$i_LM_WRITEFILE: Set to "y" if package should write out
  244. #        custom/LM_WRITEFILE. Default: use value of LM_WRITEFILE.
  245. # PKG_$i_AUTOSYMLINK: Value for AUTOSYMLINK for this package. Default: use AUTOSYMLINK.
  246. #        Only values that make sense: 1 or 0.
  247. # PKG_$i_INSTALL_METHOD: Method to use to install package.
  248. #        "tarfile" means there is a *.tar file and to use "tar xf" to install.
  249. #        "tar-to-tar" means there are flat files that should be copied by
  250. #        (cd <sourcedir> tar cf - <files> | cd <destdir> tar xfv -)
  251. #        "cp" means to do a directory copy from CD to disk.
  252. #        Default: "tarfile".
  253. # PKG_$i_TARFILE: If INSTALL_METHOD="tarfile" or "" and if using a different tarfile
  254. #                 than $CDARCHIVEFILE, name of tarfile that contains this package.
  255. # PGK_$i_FILES: If INSTALL_METHOD="tar-to-tar" or "cp", list of files to copy directly from CD 
  256. #               onto user's disk.
  257. # PGK_$i_FILES_DIRECTORY: If INSTALL_METHOD="tar-to-tar" or "cp", directory on CD 
  258. #        (relative to install script) for PKG_$i_FILES.
  259. NPKGS="2"
  260. cat << EOF > $PKGLISTFILE
  261.          # Package Description       Version    Platform      KBytes
  262.         -- -------------------       -------    --------      ------
  263.          1 AdobeIllustrator            5.5.1    IRIX 5.2      29850
  264.  
  265. EOF
  266. PKG_1_PKGFULLDESC="Adobe Illustrator Version 5.5.1 for IRIX 5.2"
  267. PKG_1_PKGDESC="Adobe Illustrator"
  268. PKG_1_VERSIONDESC="Version 5.5.1"
  269. PKG_1_PLATFORMDESC="IRIX 5.2/5.3/6.2"
  270. PKG_1_KBYTES="29850"
  271. PKG_1_PKGABBR="Illustrator"
  272. PKG_1_PKGVERS="5.5"
  273. PKG_1_BINLINKS="bin/illustrator bin/separator"
  274. PKG_1_XKEYSYMDB="0"
  275. PKG_1_SCRIPT="installscripts/postinstallq"
  276. PKG_1_LMFEATURE="AdobeIllustrator"
  277. PKG_1_LMVERSION="5.500"
  278. PKG_1_LMQUOTES=""
  279. PKG_1_CDROM_FROMFILES="readme getstart.ps support.ps KeyMapping.ps"
  280. PKG_1_CDROM_TOFILES="readme doc/getstart.ps doc/support.ps doc/KeyMapping.ps"
  281. PKG_1_FORCED_PKGS="3"
  282. PKG_1_OLD_VERSION_ACTION="prompt:leavealone/overwrite"
  283. PKG_1_HIDDEN="0"
  284. PKG_1_TARFILE=""
  285. PKG_2_PKGFULLDESC="DPS NX Basic Version 2.1.1 for "
  286. PKG_2_PKGDESC="DPS NX Basic"
  287. PKG_2_VERSIONDESC="Version 2.1.1"
  288. PKG_2_PLATFORMDESC="IRIX 5.2/5.3/6.2"
  289. PKG_2_KBYTES="4178"
  290. PKG_2_PKGABBR="DPSNXBasic"
  291. PKG_2_PKGVERS="2.1.1"
  292. PKG_2_BINLINKS="bin/dpsnx.agent"
  293. PKG_2_XKEYSYMDB="0"
  294. PKG_2_SCRIPT=""
  295. PKG_2_LMFEATURE=""
  296. PKG_2_LMVERSION=""
  297. PKG_2_LMQUOTES=""
  298. PKG_2_CDROM_FROMFILES=""
  299. PKG_2_CDROM_TOFILES=""
  300. PKG_2_FORCED_PKGS=""
  301. PKG_2_OLD_VERSION_ACTION="prompt:leavealone/overwrite"
  302. PKG_2_HIDDEN="1"
  303. PKG_2_TARFILE="../nxbasic/nxbasic.tar"
  304. PKG_2_SCRIPT="installscripts/postinstall"
  305.  
  306. # Determine how many un-hidden (i.e., visible) packages are included.
  307. NPKGS_VISIBLE=0
  308. package_num=1
  309. while [ $package_num -le $NPKGS ] ; do
  310.     packagehidden=`eval echo '$PKG_'$package_num'_HIDDEN'`
  311.     if [ "$packagehidden" != "1" ] ; then
  312.         NPKGS_VISIBLE=`expr $NPKGS_VISIBLE + 1`
  313.     fi
  314.     package_num=`expr $package_num + 1`
  315. done
  316.  
  317. # Name of CD-ROM archive file.
  318. CDARCHIVEFILE="illus.tar"
  319.  
  320. # Name of directory where CD is mounted.
  321. # If null, then directory is figured out automatically by script.
  322. #CDDIR=""
  323. # Determine name of this file on CDROM.
  324. if [ "$CDDIR" = "" ] ; then
  325.     CDDIR=`expr "$0" : '\(.*\)/'`
  326.         abspath=`expr "$0" : '^/'`
  327.     if [ "$CDDIR" = "" -o "$CDDIR" = "." ] ; then
  328.         CDDIR=`pwd`
  329.         elif [ "$abspath" != 1 ] ; then
  330.                 CDDIR=`pwd`/$CDDIR
  331.     fi
  332. fi
  333.  
  334. # Whether you must be root to run the installer.
  335. ROOT_REQUIRED="1"
  336. if [ "$ROOT_REQUIRED" = "" ] ; then
  337.     ROOT_REQUIRED="1"
  338. fi
  339.  
  340. # Whether to prompt for root directory (y or n)
  341. ROOTDIR_PROMPT="y"
  342. if [ "$ROOTDIR_PROMPT" = "" ] ; then
  343.     ROOTDIR_PROMPT="y"
  344. fi
  345.  
  346. # Whether to prompt for license data file location (y or n)
  347. LICENSE_PROMPT="n"
  348. if [ "$LICENSE_PROMPT" = "" ] ; then
  349.     LICENSE_PROMPT="y"
  350. fi
  351.  
  352. # Directory for security files.
  353. # If a relative path is given, then the path is relative to 
  354. # the directory into which the software is installed.
  355. if [ "$DFTSECURITYDIR" = "" ] ; then
  356.     DFTSECURITYDIR="/usr/local/flexlm/licenses"
  357. fi
  358.  
  359. # Directory for Adobe license daemon.
  360. # If a relative path is given, then the path is relative to 
  361. # the directory above the directory containing the license file.
  362. DAEMONDIR="sgi/v5"
  363. if [ "$DAEMONDIR" = "" ] ; then
  364.     DAEMONDIR="$DFTDAEMONDIR"
  365. fi
  366.  
  367. # License security file within license security directory.
  368. if [ "$DFTSECURITYFILE" = "" ] ; then
  369.     DFTSECURITYFILE="license.dat"
  370. fi
  371.  
  372. # Whether to install automatic symbolic links for programs
  373. # (1 or 0 or prompt or makescript)
  374. AUTOSYMLINK="y"
  375. if [ "$AUTOSYMLINK" = "" ] ; then
  376.     AUTOSYMLINK="makescript"
  377. fi
  378.  
  379. # Prompt to give for whether to establish automatic symbolic links
  380. if [ "$SYMLINK_PROMPT_1_TEXT" = "" ] ; then
  381.     SYMLINK_PROMPT_1_TEXT="This installation script places programs and/or scripts in locations that
  382. probably are not on your PATH. Do you want symbolic links for the programs
  383. and/or scripts installed in another directory (e.g., /usr/bin or /usr/local/bin)?"
  384. fi
  385.  
  386. # Prompt to give for whether to establish automatic symbolic font links
  387. if [ "$FONTLINK_PROMPT_1_TEXT" = "" ] ; then
  388.     FONTLINK_PROMPT_1_TEXT="This installation script places fonts in locations that
  389. probably are not on your PSRESOURCEPATH. Do you want symbolic links for the fonts
  390. installed in the directory for your site (e.g., /usr/psres)?"
  391. fi
  392.  
  393. # Prompt to ask for directory for automatic symbolic links
  394. if [ "$SYMLINK_PROMPT_2_TEXT" = "" ] ; then
  395.     SYMLINK_PROMPT_2_TEXT="Enter name of alternate directory for program launch scripts"
  396. fi
  397.  
  398. # Location of script which will be created if AUTOSYMLINK=makescript
  399. SYMLINKSCRIPT="/tmp/illustrator.makelinks"
  400. if [ "$SYMLINKSCRIPT" = "" ] ; then
  401.     SYMLINKSCRIPT="/tmp/adobe_install_make_links"
  402. fi
  403.  
  404. # Whether to prompt for directory for installing automatic symbolic links
  405. # (y or n)
  406. SYMLINKDIR_PROMPT="n"
  407. if [ "$SYMLINKDIR_PROMPT" = "" ] ; then
  408.     SYMLINKDIR_PROMPT="y"
  409. fi
  410.  
  411. # Directory to install automatic symbolic links for programs
  412. # If a relative path is given, then the path is relative to 
  413. # the directory into which the software is installed.
  414. if [ "$DFTSYMLINKDIR" = "" ] ; then
  415.     DFTSYMLINKDIR="/usr/bin"
  416. fi
  417.  
  418. # Directory relative to installation root dir for keeping XKeysymDB file.
  419. if [ "$XKEYSYMDBDIR" = "" ] ; then
  420.     XKEYSYMDBDIR="installscripts"
  421. fi
  422.  
  423. # File name for XKeysymDB fixes relative to XKEYSYMDBDIR.
  424. if [ "$XKEYSYMDBFILE" = "" ] ; then
  425.     XKEYSYMDBFILE="XKeysymDB"
  426. fi
  427.  
  428. # Whether to prompt for PS resource path (y or n)
  429. PSRES_PROMPT="n"
  430. if [ "$PSRES_PROMPT" = "" ] ; then
  431.     PSRES_PROMPT="n"
  432. fi
  433.  
  434. # Whether to write out a file pointing to PSRES_PATH (y or n)
  435. PSRES_WRITEFILE="y"
  436. if [ "$PSRES_WRITEFILE" = "" ] ; then
  437.     PSRES_WRITEFILE="n"
  438. fi
  439.  
  440. # Default list of directories into which application will look for
  441. # PostScript resources
  442. if [ "$PSRES_DEFAULT" = "" ] ; then
  443.     PSRES_DEFAULT='$HOME/psres:/usr/psres'
  444. fi
  445.  
  446. # File name to write out value of PSRES_PATH (for PSRES_WRITEFILE=y)
  447. # If a relative path is given, then the path is relative to 
  448. # the directory into which the software is installed.
  449. if [ "$PSRES_FILE" = "" ] ; then
  450.     PSRES_FILE="custom/SITE_PSRESOURCEPATH"
  451. fi
  452.  
  453. # Whether to write out a file pointing to LM_LICENSE_FILE (y or n)
  454. LM_WRITEFILE="y"
  455. if [ "$LM_WRITEFILE" = "" ] ; then
  456.     LM_WRITEFILE="n"
  457. fi
  458.  
  459. # File name to write out value of LM_LICENSE_FILE (for LM_WRITEFILE=y)
  460. # If a relative path is given, then the path is relative to 
  461. # the directory into which the software is installed.
  462. if [ "$LM_FILE" = "" ] ; then
  463.     LM_FILE="custom/LM_LICENSE_FILE"
  464. fi
  465.  
  466. # Number of times prompting loops are permitted to loop.
  467. # This is necessary on some platforms where double-clicking
  468. # on a script from the desktop causes script to run with
  469. # Return automatically supplied to all possible prompts.
  470. if [ "$LOOP_LIMIT" = "" ] ; then
  471.     LOOP_LIMIT="25"
  472. fi
  473.  
  474. # Search pattern for listing font subdirectories
  475. if [ "$FONTPATTERN" = "" ] ; then
  476.     FONTPATTERN="fonts/*.font"
  477. fi
  478.  
  479. # Are there any fonts to install?  1 for yes, 0 for no.
  480. if [ "$ANYFONTLINKS" = "" ] ; then
  481.     ANYFONTLINKS=0
  482. fi
  483.  
  484. # Whether to write out a file with user environment info
  485. if [ "$USER_INFO_WRITEFILE" = "" ] ; then
  486.     USER_INFO_WRITEFILE="n"
  487. fi
  488.  
  489. # File name to write out user info (for USER_INFO_WRITEFILE=y)
  490. # If a relative path is given, then the path is relative to 
  491. # the directory into which the software is installed.
  492. if [ "$USER_INFO_FILE" = "" ] ; then
  493.     USER_INFO_FILE="custom/user.adobe"
  494. fi
  495.  
  496.  
  497. #
  498. # Useful shell function for eliminating automounting cruft
  499. # and symbolic links.
  500. #
  501.  
  502. fix_path()
  503. {
  504.     dir="$1"
  505.     if [ ! -d "$dir" ] ; then
  506.         return 1
  507.     fi
  508.  
  509.     # Undo automounter stuff
  510.     ORIGDIR=`(cd "$dir" ; $PWDCMD)`
  511.     TESTDIR=`expr $ORIGDIR : '/[^/]*\(.*\)'`
  512.     HEAD=`expr $ORIGDIR : '\(/[^/]*\)'/`
  513.     
  514.     if [ -z "$HEAD" -o -z "$TESTDIR" ] ; then
  515.         if [ `expr $ORIGDIR : '/[/]*[^/]*$'` -gt 0 ] ; then
  516.         FIXED_PATH="$ORIGDIR"
  517.         return 0
  518.     fi
  519.     return 1
  520.     fi
  521.     
  522.     if [ ! -d "$ORIGDIR" ] ; then
  523.         return 1
  524.     fi
  525.     
  526.     if [ ! -z "$TESTDIR" -a ! -d "$TESTDIR" ] ; then
  527.         # definitely not automounted
  528.     FIXED_PATH="$ORIGDIR"
  529.     return 0
  530.     fi
  531.  
  532.     if [ `cd $ORIGDIR && $PWDCMD` = `cd $TESTDIR && $PWDCMD` ] ; then
  533.         # definitely automounted
  534.     FIXED_PATH="$TESTDIR"
  535.     return 0
  536.     fi
  537.     
  538.     # definitely not automounted
  539.     FIXED_PATH="$ORIGDIR"
  540.     return 0
  541. }
  542.  
  543. #
  544. # Prints out a file name indented four spaces
  545. # following by the type of file in parentheses.
  546. #
  547.  
  548. echo_file_name_and_type()
  549. {
  550.     filename="$1"
  551.     echo $EB"    $filename"$EE
  552.     if [ -d "$filename" ] ; then
  553.         echo "    (Directory)"
  554.     elif [ -h "$filename" ] ; then
  555.         echo "    (Symbolic link)"
  556.     elif [ -f "$filename" ] ; then
  557.         echo "    (File)"
  558.     else
  559.         echo ""
  560.     fi
  561. }
  562.  
  563.  
  564. # Process command line parameters.
  565. while [ $# -gt 0 ] ; do
  566.  
  567.     # "xxx=yyy" allows particular values from this script
  568.     # to be overwritten from the command line.
  569.     # For example, CDDIR=/usr/cdrom
  570.     nequal=`expr $1 : '[^=][^=]*=[^=][^=]*'`
  571.     if [ $nequal -ge 1 ] ; then
  572.         eval "$1"
  573.         shift
  574.     else
  575.         echo "Invalid parameter: $1"
  576.         echo "Usage: $0 [<var>=<value>]..."
  577.         exit 1
  578.     fi
  579. done
  580.  
  581. # Initialize variables
  582. RHOST=""
  583. DEVNAME=""
  584. DOSYMLINKS=0
  585. DOFONTLINKS=0
  586. CREATED=0
  587. SKIPFONTS=1
  588.  
  589. umask 022
  590.  
  591. if [ $ROOT_REQUIRED = 1 ] ; then
  592.     # Abort installation if user not superuser
  593.     if [ "$WHOAMI" != root ] ; then
  594.         echo ""
  595.         echo "You must be logged in as root to install"
  596.         echo "$DISTRIB_DESC."
  597.         echo 'Type "su root" and enter the password to become root.'
  598.         eval ${ABORTCMD}
  599.     fi
  600. fi
  601.  
  602. # Stop the script if user hit interrupt
  603. trap 'eval ${ABORTCMD}' 2
  604.  
  605. # Loop until user says to continue with the installation.
  606. outermost_loop=0
  607. while : ; do
  608.     outermost_loop=`expr $outermost_loop + 1`
  609.     if [ $outermost_loop -ge $LOOP_LIMIT ] ; then
  610.         echo ""
  611.         echo "LOOP_LIMIT exceeded."
  612.         eval ${ABORTCMD}
  613.     fi
  614.  
  615.     ALLOK1=1
  616.     $CLEAR
  617.     echo ""
  618.     echo "    Installation Script For"
  619.     echo "    ${DISTRIB_DESC}"
  620.     echo ""
  621.     echo "    Copyright (c) 1996 Adobe Systems Incorporated"
  622.     echo "    All Rights Reserved "
  623.     echo ""
  624.     sleep 2
  625.  
  626.     if [ "$ELECTRONIC_LICENSE" = "y" ] ; then
  627.         while : ; do
  628.             echo ""
  629.             echo "Before proceeding with the installation, you need to read and accept"
  630.             echo "the following Electronic End User License Agreement."
  631.             echo ""
  632.             echo "Press $RETURNKEYNAME to continue."
  633.             read A
  634.             $CLEAR
  635.             nlines=`$NLINES_CMD $CDDIR/$ELECTRONIC_LICENSE_FILE`
  636.             firstline=1
  637.             while : ; do
  638.                 if [ $firstline -gt "$nlines" ] ; then
  639.                     break
  640.                 fi
  641.                 lastline=`$EXPR $firstline + 19`
  642.                 $CLEAR
  643.                 echo ""
  644.                 sedcmd="$SED -n -e 's/^/    /g' -e '$firstline,$lastline p' $CDDIR/$ELECTRONIC_LICENSE_FILE"
  645.                 eval "$sedcmd"
  646.                 echo ""
  647.                 echo "Press $RETURNKEYNAME to continue, or type 1 and press $RETURNKEYNAME to re-print"
  648.                 echo "the Electronic End User License Agreement from the beginning."
  649.                 read A
  650.                 if [ "$A" = "1" ] ; then
  651.                     firstline=1
  652.                 else
  653.                     firstline=`$EXPR $lastline + 1`
  654.                 fi
  655.             done
  656.  
  657.             $CLEAR
  658.             accepted=0
  659.             while : ; do
  660.                 echo ""
  661.                 echo "PLEASE INDICATE YOUR ACCEPTANCE OR DECLINE OF THE FOREGOING AGREEMENT"
  662.                 echo "BY ENTERING THE WORD 'ACCEPT' OR 'DECLINE' AND THEN PRESS $RETURNKEYNAME."
  663.                 echo ""
  664.                 echo "If you wish to re-read the Electronic End User License Agreement,"
  665.                 echo "just press $RETURNKEYNAME."
  666.                 echo ""
  667.                 echo $EB"Do you ACCEPT or DECLINE the Electronic End User License Agreement? "$EE
  668.                 read A
  669.                 if [ "$A" = ACCEPT -o "$A" = accept ] ; then
  670.                     accepted=1
  671.                     $CLEAR
  672.                     echo ""
  673.                     echo "You have accepted the Electronic End User License Agreement."
  674.                     echo "Press $RETURNKEYNAME to continue with the installation process."
  675.                     read A
  676.                     $CLEAR
  677.                     break
  678.                 elif [ "$A" = DECLINE -o "$A" = decline ] ; then
  679.                     echo ""
  680.                     echo "Installation cancelled."
  681.                     echo ""
  682.                     eval ${ABORTCMD}
  683.                 elif [ "$A" != "" ] ; then
  684.                     echo ""
  685.                     echo "Invalid response. Valid responses are: ACCEPT,accept,DECLINE,decline."
  686.                     echo ""
  687.                 else
  688.                     break
  689.                 fi
  690.             done
  691.             if [ $accepted = 1 ] ; then
  692.                 break
  693.             fi
  694.         done
  695.     fi
  696.  
  697.     if [ $NPKGS_VISIBLE = 1 ] ; then
  698.         A="ALL"
  699.     elif [ "$WHICH_PACKAGES" != "prompt" ] ; then
  700.         A="$WHICH_PACKAGES"
  701.     else
  702.         echo ""
  703.         echo "The following packages are available for installation:"
  704.         echo ""
  705.         cat $PKGLISTFILE
  706.         echo ""
  707.         echo 'Choose from the following options:'
  708.         echo '  Press '$RETURNKEYNAME' for All packages.'
  709.         echo '  Type a list of package numbers separated by a space (for example: 1 2).'
  710.         echo '  Type q to quit.'
  711.         echo ''
  712.         echo $EB'Which packages do you want to install [Press '$RETURNKEYNAME' for All]? '$EE
  713.         read A
  714.         ntokens=`echo ${A} | wc -w`
  715.         if [ $ntokens -eq 0 ] ; then
  716.             A="ALL"
  717.         elif [ "$A" = "Q" -o "$A" = "q" -o "$A" = "Quit" -o "$A" = "quit" -o "$A" = "QUIT" ] ; then
  718.             eval ${ABORTCMD}
  719.         elif [ "$A" = "ALL" -o "$A" = "All" -o "$A" = "all" ] ; then
  720.             A="ALL"
  721.         else
  722.             # Convert commas to spaces
  723.             A=`echo "$A" | tr ',' ' '`
  724.  
  725.             # Make sure only valid numbers are present.
  726.             for i in $A ; do
  727.                 package_num=1
  728.                 found=0
  729.                 while [ $package_num -le $NPKGS_VISIBLE ] ; do
  730.                     if [ "$i" -eq "$package_num" ] ; then
  731.                         found=1
  732.                         break
  733.                     fi
  734.                     package_num=`expr $package_num + 1`
  735.                 done
  736.                 if [ $found = 0 ] ; then
  737.                     echo ""
  738.                     echo "Invalid entry: $i. Try again."
  739.                     echo "Press $RETURNKEYNAME to continue"
  740.                     read UNUSED
  741.                     ALLOK1=0
  742.                     break
  743.                 fi
  744.             done
  745.         fi
  746.         $CLEAR
  747.     fi
  748.  
  749.     if [ $ALLOK1 = 1 ] ; then
  750.         if [ "$A" = "ALL" ] ; then
  751.             A=""
  752.             package_num=1
  753.             while [ $package_num -le $NPKGS_VISIBLE ] ; do
  754.                 A="$A $package_num"
  755.                 package_num=`expr $package_num + 1`
  756.             done
  757.         fi
  758.  
  759.         # Sort, remove duplicates in list of requested packages to install.
  760.         PKGS_TO_INSTALL_REQUESTED=""
  761.         package_num=1
  762.         while [ $package_num -le $NPKGS_VISIBLE ] ; do
  763.             for i in $A ; do
  764.                 if [ "$i" = "$package_num" ] ; then
  765.                     PKGS_TO_INSTALL_REQUESTED="$PKGS_TO_INSTALL_REQUESTED $i"
  766.                     break
  767.                 fi
  768.             done
  769.             package_num=`expr $package_num + 1`
  770.         done
  771.  
  772.         # Add any packages which are forced by presence of other packages.
  773.         REQUESTED_PLUS_FORCED="$PKGS_TO_INSTALL_REQUESTED"
  774.         for i in $PKGS_TO_INSTALL_REQUESTED ; do
  775.             forced_pkgs=`eval echo '$PKG_'$i'_FORCED_PKGS'`
  776.             if [ "$forced_pkgs" != "" ] ; then
  777.                 REQUESTED_PLUS_FORCED="$REQUESTED_PLUS_FORCED $forced_pkgs"
  778.             fi
  779.         done
  780.  
  781.         # Sort, remove duplicates in total list of packages (forced packages also) to install.
  782.         PKGS_TO_INSTALL_TOTAL=""
  783.         package_num=1
  784.         while [ $package_num -le $NPKGS ] ; do
  785.             for i in $REQUESTED_PLUS_FORCED ; do
  786.                 if [ "$i" = "$package_num" ] ; then
  787.                     PKGS_TO_INSTALL_TOTAL="$PKGS_TO_INSTALL_TOTAL $i"
  788.                     break
  789.                 fi
  790.             done
  791.             package_num=`expr $package_num + 1`
  792.         done
  793.  
  794.         echo ""
  795.         echo ""
  796.         for package_num in ${PKGS_TO_INSTALL_REQUESTED} ; do
  797.             packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  798.             platformdesc=`eval echo '$PKG_'$package_num'_PLATFORMDESC'`
  799.             echo "$platformdesc is required to use $packagedesc"
  800.         done
  801.         echo "$osname $osversion is currently installed on this machine."
  802.     fi
  803.  
  804.     if [ $ALLOK1 = 1 ] ; then
  805.         if [ "$INSTALLDEVICE" = "" ] ; then
  806.             echo ""
  807.             cdtape_loop=0
  808.             while : ; do
  809.                 cdtape_loop=`expr $cdtape_loop + 1`
  810.                 if [ $cdtape_loop -ge $LOOP_LIMIT ] ; then
  811.                     echo ""
  812.                     echo "LOOP_LIMIT exceeded."
  813.                     eval ${ABORTCMD}
  814.                 fi
  815.                 echo ""
  816.                 echo ""
  817.                 echo "Do you want to install"
  818.                 echo "from a CD-ROM drive or a tape drive?"
  819.                 echo $EB"Type in 'c' for CD-ROM or 't' for TAPE (cdrom/tape) "$EE
  820.                 read A
  821.                 if [ "$A" = "CD-ROM" -o "$A" = "C" -o "$A" = "cdrom" -o "$A" = "c" ] ; then
  822.                     USECD=1
  823.                     DFTDEVPATH=$DFTCDROMPATH
  824.                     break
  825.                 elif [ "$A" = "TAPE" -o "$A" = "T" -o "$A" = "tape" -o "$A" = "t" ] ; then
  826.                     USECD=0
  827.                     DFTDEVPATH=$DFTTAPEPATH
  828.                     break
  829.                 else
  830.                     echo ""
  831.                     echo "You must select CD-ROM or TAPE.  Try again."
  832.                 fi
  833.             done
  834.         elif [ "$INSTALLDEVICE" = "CDROM" ] ; then
  835.             USECD=1
  836.         else
  837.             USECD=0
  838.         fi
  839.  
  840.         # Determine host and path from where release can be extracted
  841.         if [ $USECD = 1 ] ; then
  842.             DEVPATH=${CDDIR}'/'${CDARCHIVEFILE}
  843.             if [ ! -f $DEVPATH ] ; then
  844.                 echo ""
  845.                 echo "Cannot find CDROM release in ${CDDIR}."
  846.                 echo "Re-read installation instructions and start again."
  847.                 eval ${ABORTCMD}
  848.             fi
  849.         else
  850.             tapelr1_loop=0
  851.             while : ; do
  852.                 tapelr1_loop=`expr $tapelr1_loop + 1`
  853.                 if [ $tapelr1_loop -ge $LOOP_LIMIT ] ; then
  854.                     echo ""
  855.                     echo "LOOP_LIMIT exceeded."
  856.                     eval ${ABORTCMD}
  857.                 fi
  858.                 tapelr2_loop=0
  859.                 while : ; do
  860.                     tapelr2_loop=`expr $tapelr2_loop + 1`
  861.                     if [ $tapelr2_loop -ge $LOOP_LIMIT ] ; then
  862.                         echo ""
  863.                         echo "LOOP_LIMIT exceeded."
  864.                         eval ${ABORTCMD}
  865.                     fi
  866.                     echo ""
  867.                     echo ""
  868.                     echo $EB"Do you want to install from a tape "$EE
  869.                     echo "drive connected to your local"
  870.                     echo $EB"computer or from a remote host (local/remote)? "$EE
  871.                     read A
  872.                     if [ "$A" = "LOCAL" -o "$A" = "L" -o "$A" = "local" -o "$A" = "l" -o \
  873.                             $A = "REMOTE" -o "$A" = "R" -o "$A" = "remote" -o "$A" = "r" ] ; then
  874.                         if [ "$A" = "REMOTE" -o "$A" = "R" -o "$A" = "remote" -o "$A" = "r" ] ; then
  875.                             remotehost_loop=0
  876.                             while : ; do
  877.                                 remotehost_loop=`expr $remotehost_loop + 1`
  878.                                 if [ $remotehost_loop -ge $LOOP_LIMIT ] ; then
  879.                                     echo ""
  880.                                     echo "LOOP_LIMIT exceeded."
  881.                                     eval ${ABORTCMD}
  882.                                 fi
  883.                                 echo ""
  884.                                 echo $EB"Enter name of the remote host: "$EE
  885.                                 read RHOST
  886.                                 if [ "$RHOST" = "" ] ; then
  887.                                     echo ""
  888.                                     echo "You must specify a remote host.  Try again."
  889.                                 else
  890.                                     break
  891.                                 fi
  892.                             done
  893.                             # check if we can connect to remote host
  894.                             if $RSH -n $RHOST $TEST 1> /dev/null 2>&1 ; then status=0; else status=1; fi
  895.                             if [ $status != 0 ] ; then
  896.                                echo ""
  897.                                echo "You are not authorized to connect to $RHOST"
  898.                                echo "Check that your machine is listed in /.rhosts file on $RHOST."
  899.                                echo "For more help, talk to your System Administrator."
  900.                                ALLOK1=0
  901.                             fi 
  902.                         else
  903.                             RHOST=""
  904.                         fi
  905.  
  906.  
  907.                         if [ $ALLOK1 = 1 ]; then
  908.                             echo ""
  909.                             echo $EB"Specify the pathname of the device mounted on "$EE
  910.                             if [ "$RHOST" = "" ] ; then
  911.                                 echo "this computer."
  912.                             else
  913.                                 echo "$RHOST."
  914.                             fi
  915.                             echo "A tape drive usually has a default mountpoint of "$DFTDEVPATH"."
  916.                             echo "Please refer to the Installation Guide for additional information."
  917.                             echo ""
  918.                             echo $EB'Pathname of device [press '$RETURNKEYNAME' for '$DFTDEVPATH']: '$EE
  919.                             read A
  920.                             if [ "$A" = "" ] ; then
  921.                                 DEVPATH=$DFTDEVPATH
  922.                             else
  923.                                 DEVPATH=$A
  924.                             fi
  925.                         fi
  926.                         break
  927.                     else
  928.                         echo ""
  929.                         echo "You must specify LOCAL or REMOTE.  Try again."
  930.                     fi
  931.                 done
  932.  
  933.  
  934.                 if [ $ALLOK1 = 1 ] ; then
  935.                     if [ "$RHOST" = ""  ] ; then
  936.                         if [ ! -r $DEVPATH ] ; then
  937.                             echo ""
  938.                             echo "The device $DEVPATH does not exist."
  939.                             echo "You must select an available device.  Try again."
  940.                         fi
  941.                     fi
  942.                 break
  943.                 fi
  944.             done
  945.         fi
  946.     fi
  947. # INDENDATION START: <
  948.     
  949.         if [ $ALLOK1 = 1 ] ; then
  950.             if [ "$ROOTDIR_PROMPT" = "y" ] ; then
  951.                 rootdir_loop=0
  952.                 while : ; do
  953.                     rootdir_loop=`expr $rootdir_loop + 1`
  954.                     if [ $rootdir_loop -ge $LOOP_LIMIT ] ; then
  955.                         echo ""
  956.                         echo "LOOP_LIMIT exceeded."
  957.                         eval ${ABORTCMD}
  958.                     fi
  959.                     ALLOK2=1
  960.                     echo ""
  961.                     echo ""
  962.                     echo "This script installs software relative to a specified installation"
  963.                     echo "directory <installdir>. If you accept the default value for"
  964.                     echo "<installdir>, which is $DFTTOPDIR, the following directories"
  965.                     echo "will be created:"
  966.                     echo ""
  967.                     for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  968.                         packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  969.                         pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  970.                         pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  971.                         package_dir=$pabbr"_"$pver
  972.                         echo "    $DFTTOPDIR/$package_dir"
  973.                     done
  974.                     echo ""
  975.                     echo "Enter the full pathname for the installation directory"
  976.                     echo 'where you want to install the software'
  977.                     echo $EB'[press '$RETURNKEYNAME' for '$DFTTOPDIR']: '$EE
  978.                     read A
  979.                     if [ "$A" = ""  ] ; then
  980.                         TOPDIR="$DFTTOPDIR"
  981.                     else
  982.                         TOPDIR="$A"
  983.                     fi
  984.     
  985.                     # Rmove trailing '/' if any
  986.                     TOPDIR=`echo "$TOPDIR" | $SED -e 's/\/$//'`
  987.                     if [ ! -d $TOPDIR  ] ; then
  988.                         if $MKDIR $TOPDIR ; then status=0 ; else status=1; fi
  989.                         if [ $status != 0  ] ; then
  990.                             echo ""
  991.                             echo "Could not create directory $TOPDIR."
  992.                             eval ${ABORTCMD}
  993.                         fi
  994.     
  995.                     elif [ ! -w $TOPDIR  ] ; then
  996.                         echo ""
  997.                         echo "You do not have write permissions for the directory"
  998.                         echo "$TOPDIR.  Please choose another directory."
  999.                         ALLOK2=0
  1000.                     fi
  1001.                     if [ $ALLOK2 = 1 ] ; then
  1002.                         break
  1003.                     fi
  1004.                 done
  1005.             else
  1006.                 TOPDIR="$DFTTOPDIR"
  1007.                 if [ ! -d $TOPDIR  ] ; then
  1008.                     if $MKDIR $TOPDIR ; then status=0 ; else status=1; fi
  1009.                     if [ $status != 0  ] ; then
  1010.                         echo ""
  1011.                         echo "Could not create directory $TOPDIR."
  1012.                         eval ${ABORTCMD}
  1013.                     fi
  1014.     
  1015.                 elif [ ! -w $TOPDIR  ] ; then
  1016.                     echo ""
  1017.                     echo "You do not have write permissions for the directory"
  1018.                     echo "$TOPDIR."
  1019.                     eval ${ABORTCMD}
  1020.                 fi
  1021.             fi
  1022.         fi
  1023.     
  1024.         if [ $ALLOK1 = 1 ] ; then
  1025.             ANYSECURED=0
  1026.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1027.                 lmfeature=`eval echo '$PKG_'$package_num'_LMFEATURE'`
  1028.                 ntokens=`echo $lmfeature | wc -w`
  1029.                 if [ $ntokens -gt 0 ] ; then
  1030.                     ANYSECURED=1
  1031.                     break
  1032.                 fi
  1033.             done
  1034.             if [ $ANYSECURED = 1 ] ; then
  1035.                 abspath=`expr "$DFTSECURITYDIR" : '^/'`
  1036.                 if [ $abspath = 1 ] ; then
  1037.                     SECURITYDIR="$DFTSECURITYDIR"
  1038.                 else
  1039.                     SECURITYDIR=${TOPDIR}'/'"$DFTSECURITYDIR"
  1040.                 fi
  1041.                 if [ "$LICENSE_PROMPT" = "y" ] ; then
  1042.                     licensefile_loop=0
  1043.                     while : ; do
  1044.                         licensefile_loop=`expr $licensefile_loop + 1`
  1045.                         if [ $licensefile_loop -ge $LOOP_LIMIT ] ; then
  1046.                             echo ""
  1047.                             echo "LOOP_LIMIT exceeded."
  1048.                             eval ${ABORTCMD}
  1049.                         fi
  1050.                         echo ""
  1051.                         echo "Enter name of license data file."
  1052.                         echo $EB'[press '$RETURNKEYNAME' for '$SECURITYDIR'/'$DFTSECURITYFILE']: '$EE
  1053.                         read A
  1054.                         if [ "$A" != "" ] ; then
  1055.                             SECURITYFILE="$A"
  1056.                         else
  1057.                             SECURITYFILE="$SECURITYDIR/$DFTSECURITYFILE"
  1058.                         fi
  1059.                         dir=`expr "$SECURITYFILE" : '\(.*\)/'`
  1060.                         if [ "$dir" = "" -o "$dir" = "." ] ; then
  1061.                             echo ""
  1062.                             echo ""
  1063.                             echo "You must enter a fully qualified name beginning with '/'."
  1064.                             continue
  1065.                         else
  1066.                             break
  1067.                         fi
  1068.                     done
  1069.                 else
  1070.                     SECURITYFILE="$SECURITYDIR/$DFTSECURITYFILE"
  1071.                 fi
  1072.             fi
  1073.         fi
  1074.         if [ $ALLOK1 = 1 ] ; then
  1075.             ANYSYMLINKS=0
  1076.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1077.                 binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1078.                 ntokens=`echo $binlinks | wc -w`
  1079.                 if [ $ntokens -gt 0 ] ; then
  1080.                     ANYSYMLINKS=1
  1081.                 fi
  1082.                 if [ $ANYSYMLINKS -eq 1 ] ; then
  1083.                     break
  1084.                 fi
  1085.             done
  1086.             DOSYMLINKS=$ANYSYMLINKS
  1087.             DOFONTLINKS=$ANYFONTLINKS
  1088.             if [ $ANYSYMLINKS -eq 1 -o $ANYFONTLINKS -eq 1 ] ; then
  1089.                 if [ "$AUTOSYMLINK" = "makescript" ] ; then
  1090.                     dir=`expr "$SYMLINKSCRIPT" : '\(.*\)/'`
  1091.                     if [ ! -w "$dir" ] ; then
  1092.                         echo ""
  1093.                         echo ""
  1094.                         echo "You do not have permission to write to directory $dir."
  1095.                         echo "Change permissions and then rerun $0."
  1096.                         eval ${ABORTCMD}
  1097.                     fi
  1098.                     if [ -s "$SYMLINKSCRIPT" -o -f "$SYMLINKSCRIPT" ] ; then
  1099.                         if [ ! -w "$SYMLINKSCRIPT" ] ; then
  1100.                             echo ""
  1101.                             echo ""
  1102.                             echo "You do not have permission to write to file $SYMLINKSCRIPT."
  1103.                             echo "Change permissions and then rerun $0."
  1104.                             eval ${ABORTCMD}
  1105.                         fi
  1106.                         ${RM} "$SYMLINKSCRIPT"
  1107.                     fi
  1108.                     DOSYMLINKS=0
  1109.                     DOFONTLINKS=0
  1110.                 elif [ "$AUTOSYMLINK" = "prompt" ] ; then
  1111.     
  1112.                     dosymlinks_loop=0
  1113.                     while : ; do
  1114.                         dosymlinks_loop=`expr $dosymlinks_loop + 1`
  1115.                         if [ $dosymlinks_loop -ge $LOOP_LIMIT ] ; then
  1116.                             echo ""
  1117.                             echo "LOOP_LIMIT exceeded."
  1118.                             eval ${ABORTCMD}
  1119.                         fi
  1120.                         echo ""
  1121.                         echo ""
  1122.                         echo "$SYMLINK_PROMPT_1_TEXT"
  1123.                         echo $EB"[YES/NO: Press $RETURNKEYNAME for YES]: "$EE
  1124.                         read A
  1125.                         if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" -o "$A" = ""  ] ; then
  1126.                             break
  1127.                         elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1128.                             DOSYMLINKS=0
  1129.                             break
  1130.                         else
  1131.                             echo ""
  1132.                             echo "You must specify YES or NO.  Try again."
  1133.                         fi
  1134.                     done
  1135.                     dosymlinks_loop=0
  1136.                     if [ $ANYFONTLINKS -eq 1 ] ; then
  1137.                         while : ; do
  1138.                             dosymlinks_loop=`expr $dosymlinks_loop + 1`
  1139.                             if [ $dosymlinks_loop -ge $LOOP_LIMIT ] ; then
  1140.                                 echo ""
  1141.                                 echo "LOOP_LIMIT exceeded."
  1142.                                 eval ${ABORTCMD}
  1143.                             fi
  1144.                             echo ""
  1145.                             echo ""
  1146.                             echo "$FONTLINK_PROMPT_1_TEXT"
  1147.                             echo $EB"[YES/NO: Press $RETURNKEYNAME for YES]: "$EE
  1148.                             read A
  1149.                             if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" -o "$A" = ""  ] ; then
  1150.                                 break
  1151.                             elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1152.                                 DOFONTLINKS=0
  1153.                                 break
  1154.                             else
  1155.                                 echo ""
  1156.                                 echo "You must specify YES or NO.  Try again."
  1157.                             fi
  1158.                         done
  1159.                     fi
  1160.                 fi
  1161.     
  1162.     
  1163.                 if [ $DOSYMLINKS -eq 1 ] ; then
  1164.                     abspath=`expr $DFTSYMLINKDIR : '^/'`
  1165.                     if [ $abspath = 1 ] ; then
  1166.                         AUTOSYMLINKDIR="$DFTSYMLINKDIR"
  1167.                     else
  1168.                         AUTOSYMLINKDIR=${TOPDIR}'/'"$DFTSYMLINKDIR"
  1169.                     fi
  1170.                     if [ "$SYMLINKDIR_PROMPT" = "y" ] ; then
  1171.                         symlinkdir_loop=0
  1172.                         while : ; do
  1173.                             symlinkdir_loop=`expr $symlinkdir_loop + 1`
  1174.                             if [ $symlinkdir_loop -ge $LOOP_LIMIT ] ; then
  1175.                                 echo ""
  1176.                                 echo "LOOP_LIMIT exceeded."
  1177.                                 eval ${ABORTCMD}
  1178.                             fi
  1179.                             echo ""
  1180.                             echo "$SYMLINK_PROMPT_2_TEXT"
  1181.                             echo $EB'[press '$RETURNKEYNAME' for '$AUTOSYMLINKDIR']: '$EE
  1182.                             read A
  1183.                             if [ "$A" != "" ] ; then
  1184.                                 AUTOSYMLINKDIR="$A"
  1185.                             fi
  1186.                             if [ ! -d "$AUTOSYMLINKDIR"  ] ; then
  1187.                                 if $MKDIR $AUTOSYMLINKDIR ; then error=0; else error=1; fi
  1188.                                 if [ $error != 0  ] ; then
  1189.                                     echo "cannot create directory $AUTOSYMLINKDIR"
  1190.                                     eval ${ABORTCMD}
  1191.                                 fi
  1192.                                 chmod u+w $AUTOSYMLINKDIR
  1193.                             fi
  1194.                             if [ ! -w $AUTOSYMLINKDIR ] ; then
  1195.                                 echo ""
  1196.                                 echo ""
  1197.                                 echo "You do not have permission to write to $AUTOSYMLINKDIR."
  1198.                                 ALLOK1=0
  1199.                             else
  1200.                                 break
  1201.                             fi
  1202.                         done
  1203.                     else
  1204.                         if [ ! -d "$AUTOSYMLINKDIR"  ] ; then
  1205.                             if $MKDIR $AUTOSYMLINKDIR ; then error=0; else error=1; fi
  1206.                             if [ $error != 0  ] ; then
  1207.                                 echo "cannot create directory $AUTOSYMLINKDIR"
  1208.                                 eval ${ABORTCMD}
  1209.                             fi
  1210.                             chmod u+w $AUTOSYMLINKDIR
  1211.                         fi
  1212.                         if [ ! -w $AUTOSYMLINKDIR ] ; then
  1213.                             echo ""
  1214.                             echo ""
  1215.                             echo "You do not have permission to write to $AUTOSYMLINKDIR."
  1216.                             eval ${ABORTCMD}
  1217.                         fi
  1218.                     fi
  1219.                 fi
  1220.                 NEWFONTHOME=""
  1221.                 if [ $DOFONTLINKS -eq 1 ] ; then
  1222.                     while : ; do
  1223.                     for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1224.                         FONTHOME=`eval echo '$PKG_'$package_num'_FONTDIR'`
  1225.                         AUTOFONTLINKDIR="$FONTHOME"
  1226.                         fonthome="$AUTOFONTLINKDIR"
  1227.                         if [ "$SYMLINKDIR_PROMPT" = "y" ] ; then
  1228.                             symlinkdir_loop=0
  1229.                             while : ; do
  1230.                                 symlinkdir_loop=`expr $symlinkdir_loop + 1`
  1231.                                 if [ $symlinkdir_loop -ge $LOOP_LIMIT ] ; then
  1232.                                     echo ""
  1233.                                     echo "LOOP_LIMIT exceeded."
  1234.                                     eval ${ABORTCMD}
  1235.                                 fi
  1236.                                 echo ""
  1237.                                 echo ""
  1238.                                 echo "Enter the full path of the directory in which you want"
  1239.                                 echo "applications to look for fonts, or press $RETURNKEYNAME to accept"
  1240.                                 echo "the default directory.  The directory will be created if it does"
  1241.                                 echo "not exist."
  1242.                                 echo $EB'[press '$RETURNKEYNAME' for '$AUTOFONTLINKDIR']: '$EE
  1243.                                 read A
  1244.                                 if [ "$A" != "" ] ; then
  1245.                                     AUTOFONTLINKDIR="$A"
  1246.                                 fi
  1247.                                 if [ ! -d "$AUTOFONTLINKDIR"  ] ; then
  1248.                                     if $MKDIR $AUTOFONTLINKDIR ; then error=0; else error=1; fi
  1249.                                     if [ $error != 0  ] ; then
  1250.                                         echo "cannot create directory $AUTOFONTLINKDIR"
  1251.                                         eval ${ABORTCMD}
  1252.                                     fi
  1253.                                     chmod u+w $AUTOFONTLINKDIR
  1254.                                     chmod a+rx $AUTOFONTLINKDIR
  1255.                                     CREATED=1
  1256.                                 fi
  1257.                                 if [ ! -w $AUTOFONTLINKDIR ] ; then
  1258.                                     echo ""
  1259.                                     echo ""
  1260.                                     echo "You do not have permission to write to $AUTOFONTLINKDIR."
  1261.                                     ALLOK1=0
  1262.                                 else
  1263.                                     break
  1264.                                 fi
  1265.                             done
  1266.                         else
  1267.                             if [ ! -d "$AUTOFONTLINKDIR"  ] ; then
  1268.                                 if $MKDIR $AUTOFONTLINKDIR ; then error=0; else error=1; fi
  1269.                                 if [ $error != 0  ] ; then
  1270.                                     echo "cannot create directory $AUTOFONTLINKDIR"
  1271.                                     eval ${ABORTCMD}
  1272.                                 fi
  1273.                                 chmod u+w $AUTOFONTLINKDIR
  1274.                                 chmod a+rx $AUTOFONTLINKDIR
  1275.                                 CREATED=1
  1276.                             fi
  1277.                             if [ ! -w $AUTOFONTLINKDIR ] ; then
  1278.                                 echo ""
  1279.                                 echo ""
  1280.                                 echo "You do not have permission to write to $AUTOFONTLINKDIR."
  1281.                                 eval ${ABORTCMD}
  1282.                             fi
  1283.                         fi
  1284.                         # Get last line of df statement.
  1285.                         # Prepend X because if the mount point is too long,
  1286.                         # the df command will result in two lines, with the
  1287.                         # second line having blanks for the first field.
  1288.                         lastdfline="X"`$DFCMD $AUTOFONTLINKDIR | $LASTLINECMD`
  1289.             
  1290.                         # Determine if there is enough disk space for this install.
  1291.                         case $KBYTES_AVAIL_FIELD in
  1292.                             1)
  1293.                                 disk_kbytes=`echo $lastdfline | awk '{ print $1 }'`
  1294.                                 ;;
  1295.                             2)
  1296.                                 disk_kbytes=`echo $lastdfline | awk '{ print $2 }'`
  1297.                                 ;;
  1298.                             3)
  1299.                                 disk_kbytes=`echo $lastdfline | awk '{ print $3 }'`
  1300.                                 ;;
  1301.                             4)
  1302.                                 disk_kbytes=`echo $lastdfline | awk '{ print $4 }'`
  1303.                                 ;;
  1304.                             5)
  1305.                                 disk_kbytes=`echo $lastdfline | awk '{ print $5 }'`
  1306.                                 ;;
  1307.                             *)
  1308.                                 echo ""
  1309.                                 echo "Internal error. Unable to determine disk space."
  1310.                                 eval ${ABORTCMD}
  1311.                                 ;;
  1312.                         esac
  1313.                         font_kbytes=`eval echo '$PKG_'$package_num'_KBYTES'`
  1314.                         if [ $font_kbytes -ge $disk_kbytes ] ; then
  1315.                             echo ""
  1316.                             echo ""
  1317.                             echo "There is not enough disk space for the installation."
  1318.                             echo "The installation you requested requires $font_kbytes kilobytes of disk space"
  1319.                             echo "and you currently have only $disk_kbytes kilobytes of available disk space"
  1320.                             echo "in directory $AUTOFONTLINKDIR."
  1321.                             if [ "$NPKGS_VISIBLE" -gt 1 ] ; then
  1322.                                 echo "Either install fewer packages or choose a different location to install"
  1323.                                 echo "the packages."
  1324.                             else
  1325.                                 echo "Choose a different location to install the packages."
  1326.                             fi
  1327.                             echo ""
  1328.                             echo ""
  1329.                             echo "Press $RETURNKEYNAME to continue"
  1330.                             read A
  1331.             
  1332.                             # Make sure that SYMLINKDIR_PROMPT is "y" so that the next
  1333.                             # time through the user has an opportunity to pick a
  1334.                             # non-default directory.
  1335.                             SYMLINKDIR_PROMPT="y"
  1336.                             ALLOK1=0
  1337.                         fi
  1338.                         NEWFONTHOME="$NEWFONTHOME $AUTOFONTLINKDIR"
  1339.                     done
  1340.                     if [ $ALLOK1 -eq 1 ] ; then
  1341.                         break
  1342.                     else
  1343.                         ALLOK1=1
  1344.                         NEWFONTHOME=""
  1345.                     fi
  1346.                     done # while
  1347.                 fi
  1348.             fi
  1349.         fi
  1350.         
  1351.         # See if we will override any existing fonts with auto symbolic links.
  1352.         FONTLINKANYOLD=0
  1353.         tfonthome="$NEWFONTHOME"
  1354.         if [ $ALLOK1 -eq 1 -a $DOFONTLINKS -eq 1 ] ; then
  1355.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1356.                 fonthome=`eval echo '$PKG_'$package_num'_FONTDIR'`
  1357.                 newfonthome=`expr "$tfonthome" : '[ ]*\([^ ]*\)[ ]*'`
  1358.                 tfonthome=`expr "$tfonthome" : '[ ]*[^ ]*\(.*\)'`
  1359.                 if [ ! -z "$newfonthome" -a "$fonthome" != "$newfonthome" ] ; then
  1360.                     fonthome="$newfonthome"
  1361.                 fi
  1362.                 if [ ! -z "$fonthome" ] ; then
  1363.                     if [ -d $fonthome -o -h $fonthome ]; then
  1364.                         FONTLINKANYOLD=1
  1365.                         break
  1366.                     fi
  1367.                 fi
  1368.             done
  1369.         fi
  1370.         if [ $FONTLINKANYOLD -eq 1 ] ; then
  1371.             if [ $CREATED -ne 1 ] ; then
  1372.                 while : ; do
  1373.                 echo ""
  1374.                 echo ""
  1375.                 echo "*** Warning ***"
  1376.                 echo "Some fonts are already installed in $fonthome.  This script"
  1377.                 echo "checks the name of each font to be installed against those already"
  1378.                 echo "installed in $fonthome.  You may choose to skip the"
  1379.                 echo "installation of fonts whose names match, or you may replace matching"
  1380.                 echo "fonts.  Fonts with no matching name will be installed regardless."   
  1381.                 echo ""
  1382.                 echo $EB"Do you want to replace fonts with matching names (YES/NO)? "$EE
  1383.                 read A
  1384.                 if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" -o "$A" = ""  ] ; then
  1385.                     SKIPFONTS=0
  1386.                     break
  1387.                 elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1388.                     SKIPFONTS=1
  1389.                     break
  1390.                 else
  1391.                     echo ""
  1392.                     echo "You must specify YES or NO.  Try again."
  1393.                 fi
  1394.             done
  1395.             fi
  1396.         fi
  1397. # INDENDATION END
  1398.  
  1399.     if [ $ALLOK1 = 1 ] ; then
  1400.         PSRES_PATH=""
  1401.         if [ "$PSRES_PROMPT" = "y" ] ; then
  1402.             echo ""
  1403.             echo ""
  1404.             # FLAGTAG Don't we have a variable we can use for the application name?
  1405.             echo "Enter a list of directories, separated by colons, where the application"
  1406.             echo "you are installing should look for fonts.  The following recommended"
  1407.             echo "directories are included automatically and need not be specified."
  1408.             echo ""
  1409.             echo "   $PSRES_DEFAULT"
  1410.             echo ""
  1411.             echo "Enter a list of additional font directories"
  1412.             echo $EB"[Press $RETURNKEYNAME to accept the recommended directories]: "$EE
  1413.             read PSRES_PATH
  1414.         fi
  1415.         if [ "$PSRES_PATH" = "" ] ; then
  1416.             PSRES_PATH="$PSRES_DEFAULT"
  1417.         elif [ "$PSRES_DEFAULT" != "" ] ; then
  1418.             PSRES_PATH="$PSRES_PATH:$PSRES_DEFAULT"
  1419.         fi
  1420.     fi
  1421.  
  1422.     ANY_XKEYSYMDB=0
  1423.     for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1424.         xkeysymdb=`eval echo '$PKG_'$package_num'_XKEYSYMDB'`
  1425.         if [ "$xkeysymdb" = 1 ] ; then
  1426.             ANY_XKEYSYMDB=1
  1427.             break
  1428.         fi
  1429.     done
  1430.  
  1431.     # Only ask next set of questions if user answered YES above.
  1432.     if [ $ALLOK1 = 1 ] ; then
  1433.  
  1434.         # See if any files and/or directories already exist with target names.
  1435.         for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1436.             eval "PKG_"$package_num"_OLD_VERSION_CHOICE=newinstallation"
  1437.             packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  1438.             pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1439.             pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1440.             binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1441.             paction=`eval echo '$PKG_'$package_num'_OLD_VERSION_ACTION'`
  1442.             package_dir=$pabbr"_"$pver
  1443.             autosymlink=`eval echo '$PKG_'$package_num'_AUTOSYMLINK'`
  1444.             if [ "$autosymlink" = "" ] ; then
  1445.                 autosymlink="$DOSYMLINKS"
  1446.             fi
  1447.             fulldir=$TOPDIR/$package_dir
  1448.             if [ -d $fulldir -o -f $fulldir -o -h $fulldir ] ; then
  1449.                 package_exists=1
  1450.             else
  1451.                 package_exists=0
  1452.             fi
  1453.             link_exists=0
  1454.             ntokens=`echo $binlinks | wc -w`
  1455.             if [ "$autosymlink" = 1 -a $ntokens -gt 0 ] ; then
  1456.                 for bin in $binlinks ; do
  1457.                     # Next line is equiv to csh: set name=$bin:t
  1458.                     name=`expr //$bin : '.*/\(.*\)'`
  1459.                     if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ]; then
  1460.                         link_exists=1
  1461.                         break
  1462.                     fi
  1463.                 done
  1464.             fi
  1465.             if [ "$package_exists" = 1 -o "$link_exists" = 1 ] ; then
  1466.  
  1467.                 case "$paction" in
  1468.                 "quiet:leavealone"|"quiet:overwrite")
  1469.                     break
  1470.                     ;;
  1471.                  "prompt:leavealone/overwrite")
  1472.                     leavealonedir_loop=0
  1473.                     while : ; do
  1474.                         leavealonedir_loop=`expr $leavealonedir_loop + 1`
  1475.                         if [ $leavealonedir_loop -ge $LOOP_LIMIT ] ; then
  1476.                             echo ""
  1477.                             echo "LOOP_LIMIT exceeded."
  1478.                             eval ${ABORTCMD}
  1479.                         fi
  1480.                         echo "" 
  1481.                         echo ""
  1482.                         echo "*** WARNING ***"
  1483.                         echo "Components of $packagedesc are already installed on"
  1484.                         echo "your system in the following locations. You can either"
  1485.                         echo "leave the existing installation unchanged or re-install"
  1486.                         echo "$packagedesc, thereby replacing all of the"
  1487.                         echo "files/directories listed below. If you choose to re-install,"
  1488.                         echo "be sure to copy any personal files or customizations within"
  1489.                         echo "these files/directories to another location before continuing"
  1490.                         echo "with this procedure:"
  1491.                         echo ""
  1492.                         if [ "$package_exists" = 1 ] ; then
  1493.                             echo_file_name_and_type "$fulldir"
  1494.                         fi
  1495.                         if [ "$link_exists" = 1 ] ; then
  1496.                             ntokens=`echo $binlinks | wc -w`
  1497.                             if [ $ntokens -gt 0 ] ; then
  1498.                                 for bin in $binlinks ; do
  1499.                                     # Next line is equiv to csh: set name=$bin:t
  1500.                                     name=`expr //$bin : '.*/\(.*\)'`
  1501.                                     if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ]; then
  1502.                                         echo_file_name_and_type "$AUTOSYMLINKDIR/$name"
  1503.                                     fi
  1504.                                 done
  1505.                             fi
  1506.                         fi
  1507.  
  1508.                         echo ""
  1509.                         echo "Do you wish to install $packagedesc, replacing the"
  1510.                         echo $EB"above components (YES/NO) [press $RETURNKEYNAME for NO]: "$EE
  1511.                         read A
  1512.                         echo ""
  1513.                         if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  1514.                             eval "PKG_"$package_num"_OLD_VERSION_CHOICE=overwrite"
  1515.                             break
  1516.                         elif [ "$A" = "" -o "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1517.                             eval "PKG_"$package_num"_OLD_VERSION_CHOICE=leavealone"
  1518.                             break
  1519.                         else
  1520.                             echo ""
  1521.                             echo "You must specify YES or NO or simply press $RETURNKEYNAME for NO.  Try again."
  1522.                         fi
  1523.                     done
  1524.                     ;;
  1525.                 *|"prompt:oktodelete")
  1526.                     overwritedir_loop=0
  1527.                     while : ; do
  1528.                         overwritedir_loop=`expr $overwritedir_loop + 1`
  1529.                         if [ $overwritedir_loop -ge $LOOP_LIMIT ] ; then
  1530.                             echo ""
  1531.                             echo "LOOP_LIMIT exceeded."
  1532.                             eval ${ABORTCMD}
  1533.                         fi
  1534.                         echo "" 
  1535.                         echo ""
  1536.                         echo "*** WARNING ***"
  1537.                         echo "The following files and/or directories already exist for"
  1538.                         echo "$packagedesc.  If you continue with this installation"
  1539.                         echo "you will overwrite them.  Be sure to copy any personal"
  1540.                         echo "files to another location before continuing the installation."
  1541.                         echo ""
  1542.                         echo "    $fulldir"
  1543.                         ntokens=`echo $binlinks | wc -w`
  1544.                         if [ $ntokens -gt 0 ] ; then
  1545.                             for bin in $binlinks ; do
  1546.                                 # Next line is equiv to csh: set name=$bin:t
  1547.                                 name=`expr //$bin : '.*/\(.*\)'`
  1548.                                 if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ]; then
  1549.                                     echo "    $AUTOSYMLINKDIR/$name"
  1550.                                 fi
  1551.                             done
  1552.                         fi
  1553.                         echo ""
  1554.                         echo $EB"OK to proceed (YES/NO)? "$EE
  1555.                         read A
  1556.                         echo ""
  1557.                         if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  1558.                             eval "PKG_"$package_num"_OLD_VERSION_CHOICE=overwrite"
  1559.                             break
  1560.                         elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1561.                             echo ""
  1562.                             echo "Please specify a different location for installing the packages"
  1563.                             if [ "$WHICH_PACKAGES" = "prompt" ] ; then
  1564.                                 echo "or a different set of packages to install"
  1565.                             fi
  1566.                             echo "Press $RETURNKEYNAME to restart the script or use your interrupt key to exit the script"
  1567.                             read A
  1568.                             ALLOK1=0
  1569.                             break
  1570.                         else
  1571.                             echo ""
  1572.                             echo "You must specify YES or NO.  Try again."
  1573.                         fi
  1574.                     done
  1575.                     ;;
  1576.                 esac
  1577.             fi
  1578.             if [ "$ALLOK1" != 1 ] ; then
  1579.                 break
  1580.             fi
  1581.         done
  1582.  
  1583.         # Adjust PKGS_TO_INSTALL_REQUESTED and PKGS_TO_INSTALL_TOTAL to reflect
  1584.         # decisions not to install over existing packages.
  1585.         NEW_PKGS_REQUESTED=""
  1586.         for package_num in ${PKGS_TO_INSTALL_REQUESTED} ; do
  1587.             pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1588.             if [ "$pchoice" != "leavealone" ] ; then
  1589.                 NEW_PKGS_REQUESTED="$NEW_PKGS_REQUESTED $package_num"
  1590.             fi
  1591.         done
  1592.         NEW_PKGS_TOTAL=""
  1593.         for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1594.             pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1595.             if [ "$pchoice" != "leavealone" ] ; then
  1596.                 NEW_PKGS_TOTAL="$NEW_PKGS_TOTAL $package_num"
  1597.             fi
  1598.         done
  1599.         PKGS_TO_INSTALL_REQUESTED="$NEW_PKGS_REQUESTED"
  1600.         PKGS_TO_INSTALL_TOTAL="$NEW_PKGS_TOTAL"
  1601.  
  1602.         if [ "$PKGS_TO_INSTALL_TOTAL" = "" ] ; then
  1603.             echo ""
  1604.             echo "No packages require installation."
  1605.             eval ${ABORTCMD}
  1606.         fi
  1607.  
  1608.         if [ $ALLOK1 = 1 ] ; then
  1609.             # Get last line of df statement.
  1610.             # Prepend X because if the mount point is too long,
  1611.             # the df command will result in two lines, with the
  1612.             # second line having blanks for the first field.
  1613.             lastdfline="X"`$DFCMD ${TOPDIR} | $LASTLINECMD`
  1614.  
  1615.             # Determine if there is enough disk space for this install.
  1616.             case $KBYTES_AVAIL_FIELD in
  1617.                 1)
  1618.                     disk_kbytes=`echo $lastdfline | awk '{ print $1 }'`
  1619.                     ;;
  1620.                 2)
  1621.                     disk_kbytes=`echo $lastdfline | awk '{ print $2 }'`
  1622.                     ;;
  1623.                 3)
  1624.                     disk_kbytes=`echo $lastdfline | awk '{ print $3 }'`
  1625.                     ;;
  1626.                 4)
  1627.                     disk_kbytes=`echo $lastdfline | awk '{ print $4 }'`
  1628.                     ;;
  1629.                 5)
  1630.                     disk_kbytes=`echo $lastdfline | awk '{ print $5 }'`
  1631.                     ;;
  1632.                 *)
  1633.                     echo ""
  1634.                     echo "Internal error. Unable to determine disk space."
  1635.                     eval ${ABORTCMD}
  1636.                     ;;
  1637.             esac
  1638.             total_kbytes=0
  1639.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1640.                 pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1641.                 pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1642.                 package_dir=$pabbr"_"$pver
  1643.                 fulldir=$TOPDIR/$package_dir
  1644.                 pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1645.                 if [ "$pchoice" = "newinstallation" ] ; then
  1646.                     kbytes=`eval echo '$PKG_'$package_num'_KBYTES'`
  1647.                     total_kbytes=`expr $total_kbytes + $kbytes`
  1648.                 elif [ "$pchoice" = "overwrite" ] ; then
  1649.                     oldkbytes=`$DUCMD $fulldir | $AWK '{print $1;}'`
  1650.                     # IRIX 5.3 du command returns nothing if the $fulldir does not exist
  1651.                     if [ "X$oldkbytes" = "X" ] ; then
  1652.                         oldkbytes=0
  1653.                     fi
  1654.                     # HP-UX has no option for printing kbytes, only blocks.
  1655.                     # So, scale down by .5 on that platform.
  1656.                     oldkbytes=`expr $oldkbytes \* $DUFACTOR`
  1657.                     newkbytes=`eval echo '$PKG_'$package_num'_KBYTES'`
  1658.                     total_kbytes=`expr $total_kbytes + $newkbytes - $oldkbytes`
  1659.                 fi
  1660.             done
  1661.             if [ $total_kbytes -ge $disk_kbytes ] ; then
  1662.                 echo ""
  1663.                 echo ""
  1664.                 echo "There is not enough disk space for the installation."
  1665.                 echo "The installation you requested requires $total_kbytes kilobytes of disk space"
  1666.                 echo "and you currently have only $disk_kbytes kilobytes of available disk space"
  1667.                 echo "in directory ${TOPDIR}."
  1668.                 if [ "$NPKGS_VISIBLE" -gt 1 ] ; then
  1669.                     echo "Either install fewer packages or choose a different location to install"
  1670.                     echo "the packages."
  1671.                 else
  1672.                     echo "Choose a different location to install the packages."
  1673.                 fi
  1674.                 echo ""
  1675.                 echo ""
  1676.                 echo "Press $RETURNKEYNAME to continue"
  1677.                 read A
  1678.  
  1679.                 # Make sure that ROOTDIR_PROMPT is "y" so that the next
  1680.                 # time through the user has an opportunity to pick a
  1681.                 # non-default <root directory>.
  1682.                 ROOTDIR_PROMPT="y"
  1683.                 ALLOK1=0
  1684.             fi
  1685.         fi
  1686.     fi
  1687.  
  1688.     if [ $ALLOK1 = 1 ] ; then
  1689.         $CLEAR
  1690.         echo ""
  1691.         echo "Installation summary:"
  1692.         echo ""
  1693.  
  1694.         okproceed_loop=0
  1695.         while : ; do
  1696.             okproceed_loop=`expr $okproceed_loop + 1`
  1697.             if [ $okproceed_loop -ge $LOOP_LIMIT ] ; then
  1698.                 echo ""
  1699.                 echo "LOOP_LIMIT exceeded."
  1700.                 eval ${ABORTCMD}
  1701.             fi
  1702.             # Check to see if anything will be deleted.
  1703.             anydelete=0
  1704.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1705.                 pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1706.                 pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1707.                 binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1708.                 pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1709.                 package_dir=$pabbr"_"$pver
  1710.                 autosymlink=`eval echo '$PKG_'$package_num'_AUTOSYMLINK'`
  1711.                 if [ "$autosymlink" = "" ] ; then
  1712.                     autosymlink="$DOSYMLINKS"
  1713.                 fi
  1714.                 fulldir=$TOPDIR/$package_dir
  1715.                 if [ -d $fulldir -o -f $fulldir -o -h $fulldir ] ; then
  1716.                     package_exists=1
  1717.                 else
  1718.                     package_exists=0
  1719.                 fi
  1720.                 link_exists=0
  1721.                 ntokens=`echo $binlinks | wc -w`
  1722.                 if [ "$autosymlink" = 1 -a $ntokens -gt 0 ] ; then
  1723.                     for bin in $binlinks ; do
  1724.                         # Next line is equiv to csh: set name=$bin:t
  1725.                         name=`expr //$bin : '.*/\(.*\)'`
  1726.                         if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ]; then
  1727.                             link_exists=1
  1728.                             break
  1729.                         fi
  1730.                     done
  1731.                 fi
  1732.                 if [ "$package_exists" = 1 -o "$link_exists" = 1 ] ; then
  1733.                     if [ "$pchoice" = "overwrite" ] ; then
  1734.                         anydelete=1
  1735.                         break
  1736.                     fi
  1737.                 fi
  1738.             done
  1739.             if [ "$anydelete" = 1 ] ; then
  1740.                 echo ""
  1741.                 echo "The following files and/or directories will be overwritten."
  1742.                 echo ""
  1743.                 for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1744.                     pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1745.                     pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1746.                     binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1747.                     pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1748.                     package_dir=$pabbr"_"$pver
  1749.                     autosymlink=`eval echo '$PKG_'$package_num'_AUTOSYMLINK'`
  1750.                     if [ "$autosymlink" = "" ] ; then
  1751.                         autosymlink="$DOSYMLINKS"
  1752.                     fi
  1753.                     fulldir=$TOPDIR/$package_dir
  1754.                     if [ "$pchoice" = "overwrite" ] ; then
  1755.                         if [ -d $fulldir -o -f $fulldir -o -h $fulldir ] ; then
  1756.                             echo_file_name_and_type "$fulldir"
  1757.                         fi
  1758.                         ntokens=`echo $binlinks | wc -w`
  1759.                         if [ "$autosymlink" = 1 -a $ntokens -gt 0 ] ; then
  1760.                             for bin in $binlinks ; do
  1761.                                 # Next line is equiv to csh: set name=$bin:t
  1762.                                 name=`expr //$bin : '.*/\(.*\)'`
  1763.                                 if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ]; then
  1764.                                     echo_file_name_and_type "$AUTOSYMLINKDIR/$name"
  1765.                                 fi
  1766.                             done
  1767.                         fi
  1768.                     fi
  1769.                 done
  1770.             fi
  1771.             echo ""
  1772.             echo "The following packages will be installed."
  1773.             echo ""
  1774.             for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1775.                 pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1776.                 pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1777.                 package_dir=$pabbr"_"$pver
  1778.                 fulldir=$TOPDIR/$package_dir
  1779.                 kbytes=`eval echo '$PKG_'$package_num'_KBYTES'`
  1780.                 echo "    "$fulldir '('$kbytes'K)'
  1781.             done
  1782.  
  1783.             if [ $DOSYMLINKS = 1 ] ; then
  1784.                 echo ""
  1785.                 echo "The following symbolic links will be created:"
  1786.                 echo ""
  1787.                 for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1788.                     packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  1789.                     pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1790.                     pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1791.                     package_dir=$pabbr"_"$pver
  1792.                     fulldir=$TOPDIR/$package_dir
  1793.                     binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1794.                     ntokens=`echo $binlinks | wc -w`
  1795.                     if [ $ntokens -gt 0 ] ; then
  1796.                         for bin in $binlinks ; do
  1797.                             # Next line is equiv to csh: set name=$bin:t
  1798.                             name=`expr //$bin : '.*/\(.*\)'`
  1799.                             echo "    ${LN} $fulldir/$bin $AUTOSYMLINKDIR/$name"
  1800.                         done
  1801.                     fi
  1802.                 done
  1803.             fi
  1804.             if [ $DOFONTLINKS = 1 ] ; then
  1805.                 echo ""
  1806.                 echo "The following commands will be executed for fonts:"
  1807.                 echo ""
  1808.                 tfonthome="$NEWFONTHOME"
  1809.                 for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1810.                     packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  1811.                     pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1812.                     pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1813.                     package_dir=$pabbr"_"$pver
  1814.                     fulldir=$TOPDIR/$package_dir
  1815.                     uprfile=`eval echo '$PKG_'$package_num'_FONTUPR'`
  1816.                     fonthome=`eval echo '$PKG_'$package_num'_FONTDIR'`
  1817.                     newfonthome=`expr "$tfonthome" : '[ ]*\([^ ]*\)[ ]*'`
  1818.                     tfonthome=`expr "$tfonthome" : '[ ]*[^ ]*\(.*\)'`
  1819.                     if [ ! -z "$newfonthome" -a "$fonthome" != "$newfonthome" ] ; then
  1820.                         fonthome="$newfonthome"
  1821.                     fi
  1822.                     echo "    ${DIRCP} $fulldir/$FONTPATTERN $fonthome"
  1823.                     if [ "$AUTOSYMLINK" != "makescript" ] ; then
  1824.                         echo "    ${DIRRM} $fulldir/$FONTPATTERN"
  1825.                     fi
  1826.                     name=`expr //$uprfile : '.*/\(.*\)'`
  1827.                     if [ -z "$name" ] ; then
  1828.                         name="$uprfile"
  1829.                     fi
  1830.                     dir=`expr "$fonthome" : '\(.*\)/'`
  1831.                     echo "    ${CP} $fulldir/$uprfile $dir/$name"
  1832.                     # X font info files
  1833.                     fdir=`expr "$FONTPATTERN" : '\(.*\)/'`
  1834.                     if [ -f $fulldir/$fdir/fonts.dir ] ; then
  1835.                         echo "    ${CP} $fulldir/$fdir/fonts.dir $fonthome"
  1836.                     fi
  1837.                     if [ -f $fulldir/$fdir/fonts.alias ] ; then
  1838.                         echo "    ${CP} $fulldir/$fdir/fonts.alias $fonthome"
  1839.                     fi
  1840.                 done
  1841.             fi
  1842.             echo ""
  1843.             echo ""
  1844.             echo $EB'Do you want to proceed with the installation (YES/NO)? '$EE
  1845.             read A
  1846.             if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  1847.                 echo ""
  1848.                 break
  1849.             elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  1850.                 eval ${ABORTCMD}
  1851.             else
  1852.                 echo ""
  1853.                 echo "You must specify YES or NO.  Try again."
  1854.             fi
  1855.         done
  1856.     fi
  1857.  
  1858.     # Can we proceed with the installation?
  1859.     if [ $ALLOK1 = 1 ] ; then
  1860.         break
  1861.     fi
  1862. done
  1863.  
  1864. $CLEAR
  1865. echo "" 
  1866. echo ""
  1867. echo "Beginning installation..."
  1868. echo ""
  1869. echo "This may take some time, depending on the number of items"
  1870. echo "you have selected and the performance of your chosen device."
  1871. echo ""
  1872.  
  1873. # Remove any files and/or directories that will be overwritten.
  1874. if [ "$anydelete" = 1 ] ; then
  1875.     echo ""
  1876.     echo "Removing the following files and/or directories:"
  1877.     for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1878.         pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1879.         pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1880.         binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  1881.         pchoice=`eval echo '$PKG_'$package_num'_OLD_VERSION_CHOICE'`
  1882.         package_dir=$pabbr"_"$pver
  1883.         fulldir=$TOPDIR/$package_dir
  1884.         autosymlink=`eval echo '$PKG_'$package_num'_AUTOSYMLINK'`
  1885.         if [ "$autosymlink" = "" ] ; then
  1886.             autosymlink="$DOSYMLINKS"
  1887.         fi
  1888.         if [ "$pchoice" = "overwrite" ] ; then
  1889.             if [ -d $fulldir -o -f $fulldir -o -h $fulldir ] ; then
  1890.                 echo $EB"    "$fulldir"..."$EE
  1891.                 ${RM} -r $fulldir
  1892.                 echo done
  1893.             fi
  1894.             if [ "$autosymlink" = 1 ] ; then
  1895.                 ntokens=`echo $binlinks | wc -w`
  1896.                 if [ $ntokens -gt 0 ] ; then
  1897.                     for bin in $binlinks ; do
  1898.                         # Next line is equiv to csh: set name=$bin:t
  1899.                         name=`expr //$bin : '.*/\(.*\)'`
  1900.                         if [ -f $AUTOSYMLINKDIR/$name -o -d $AUTOSYMLINKDIR/$name -o -h $AUTOSYMLINKDIR/$name ] ; then
  1901.                             echo $EB"    $AUTOSYMLINKDIR/$name..."$EE
  1902.                             ${RM} -r $AUTOSYMLINKDIR/$name
  1903.                             echo done
  1904.                         fi
  1905.                     done
  1906.                 fi
  1907.             fi
  1908.         fi
  1909.     done
  1910.     echo ""
  1911. fi
  1912.  
  1913. # First, with package_num_tar==0, loop through all packages to see which
  1914. # ones use the default tar file ($DEVPATH). Build a list and extract the files.
  1915. # Then, for each package with own special tar file, loop through all
  1916. # packages to see what other packages use that special tar file.
  1917. # The logic causes each package to be extracted exactly once.
  1918. # For each different tar file, build a list of packages to extract.
  1919. # Then, extract the desired packages.
  1920. for package_num_tar in 0 ${PKGS_TO_INSTALL_TOTAL} ; do
  1921.     INSTALL_METHOD=`eval echo '$PKG_'$package_num_tar'_INSTALL_METHOD'`
  1922.     if [ "$INSTALL_METHOD" = "" -o "$INSTALL_METHOD" = "tarfile" ] ; then
  1923.         if [ "$package_num_tar" -eq 0 ] ; then
  1924.             TARFILE="$DEVPATH"
  1925.             if [ "$TARFILE" = "" ] ; then
  1926.                 continue
  1927.             fi
  1928.         else
  1929.             TARFILE_RELATIVE=`eval echo '$PKG_'$package_num_tar'_TARFILE'`
  1930.             if [ "$TARFILE_RELATIVE" = "" ] ; then
  1931.                 continue
  1932.             fi
  1933.             TARFILE="$CDDIR/$TARFILE_RELATIVE"
  1934.         fi
  1935.  
  1936.         # Build the list of packages to extract from this tar file.
  1937.         FILELIST=""
  1938.         for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  1939.             pextracted=`eval echo '$PKG_'$package_num'_EXTRACTED'`
  1940.             if [ "$pextracted" = 1 ] ; then
  1941.                 continue
  1942.             fi
  1943.             installmethod=`eval echo '$PKG_'$package_num'_INSTALL_METHOD'`
  1944.             if [ "$installmethod" = "" -o "$installmethod" = "tarfile" ] ; then
  1945.                 ptarfile=`eval echo '$PKG_'$package_num'_TARFILE'`
  1946.                 pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  1947.                 pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  1948.                 package_dir=$pabbr"_"$pver
  1949.                 if [ "$ptarfile" = "" -a "$package_num_tar" -eq 0 ] ; then
  1950.                     FILELIST=${FILELIST}\'$package_dir\'' '
  1951.                     eval "PKG_"$package_num"_EXTRACTED=1"
  1952.                 elif [ "$ptarfile" = "$TARFILE_RELATIVE" ] ; then
  1953.                     FILELIST=${FILELIST}\'$package_dir\'' '
  1954.                     eval "PKG_"$package_num"_EXTRACTED=1"
  1955.                 fi
  1956.             fi
  1957.         done
  1958.  
  1959.         # Extract the desired packages.
  1960.         if [ "$FILELIST" != "" ] ; then
  1961.             if [ "$RHOST" = "" ] ; then
  1962.                 INSTALLCOMMAND="$TAR $TAR_OPTS_X $TARFILE ${FILELIST}"
  1963.             else
  1964.                 INSTALLCOMMAND="rsh -n $RHOST dd if=$TARFILE | $TAR $TAR_OPTS_X ${FILELIST}"
  1965.             fi
  1966.             olddir=`pwd`
  1967.             cd $TOPDIR
  1968.             eval "${INSTALLCOMMAND}"
  1969.             cd $olddir
  1970.         fi
  1971.     elif [ "$INSTALL_METHOD" = "tar-to-tar" -o "$INSTALL_METHOD" = "cp" ] ; then
  1972.         FILES=`eval echo '$PKG_'$package_num_tar'_FILES'`
  1973.         FILES_DIRECTORY=`eval echo '$PKG_'$package_num_tar'_FILES_DIRECTORY'`
  1974.  
  1975.         # Extract the desired packages.
  1976.         if [ "$FILES" != "" ] ; then
  1977.             if [ "$RHOST" = "" ] ; then
  1978.                 if [ "$INSTALL_METHOD" = "tar-to-tar" ] ; then
  1979.                     INSTALLCOMMAND='('"cd $CDDIR/$FILES_DIRECTORY"';'"$TAR $TAR_OPTS_C - ${FILES}"')|('"cd $TOPDIR"';'"$TAR $TAR_OPTS_X -"')'
  1980.                 elif [ "$INSTALL_METHOD" = "cp" ] ; then
  1981.                     INSTALLCOMMAND='('"cd $CDDIR/$FILES_DIRECTORY"';'"$DIRCP ${FILES} $TOPDIR"')'
  1982.                 else
  1983.                     # Shouldn't happen.
  1984.                     INSTALLCOMMAND="Error in install script"
  1985.                 fi
  1986.             else
  1987.                 echo ""
  1988.                 echo "Cannot extract package from remote host."
  1989.                 eval ${ABORTCMD}
  1990.             fi
  1991.                         if [ "$INSTALL_METHOD" = "cp" ] ; then
  1992.                                 echo $EB"Copy ${FILES} to $TOPDIR..."$EE
  1993.                         fi
  1994.             eval "${INSTALLCOMMAND}"
  1995.                         if [ "$INSTALL_METHOD" = "cp" ] ; then
  1996.                                 echo "done"
  1997.                         fi
  1998.         fi
  1999.     else
  2000.         echo ""
  2001.         echo 'Invalid value for PKG_'$package_num_tar'_INSTALL_METHOD.'
  2002.         eval ${ABORTCMD}
  2003.     fi
  2004.     
  2005. done
  2006.  
  2007. # Process packages
  2008. ALREADY_XKEYSYMDB=0
  2009. LMFEATURELIST=""
  2010. MAKESCRIPT=0
  2011. ONESCRIPT=0
  2012. for package_num in 0 ${PKGS_TO_INSTALL_TOTAL} ; do
  2013.     PERPKGFONTSIZE=""
  2014.     packagedesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  2015.     pabbr=`eval echo '$PKG_'$package_num'_PKGABBR'`
  2016.     pver=`eval echo '$PKG_'$package_num'_PKGVERS'`
  2017.     package_dir=$pabbr"_"$pver
  2018.     fulldir=$TOPDIR/$package_dir
  2019.     autosymlink=`eval echo '$PKG_'$package_num'_AUTOSYMLINK'`
  2020.     if [ "$autosymlink" = "" ] ; then
  2021.         autosymlink="$DOSYMLINKS"
  2022.     fi
  2023.  
  2024.     # Install makelinks scripts for all installed packages in /tmp if "makescript" and
  2025.     # any symlinks in this installation.
  2026.     # Install makelinks scripts for each package in installscripts/ if
  2027.     # package_num>0 and any symlinks.
  2028.     lnks=`expr $ANYSYMLINKS + $ANYFONTLINKS`
  2029.     if [ package_num -eq 0 -a "$AUTOSYMLINK" = "makescript" -a $lnks -ge 1 -o $package_num -ge 1 -a "$autosymlink" != "0" ] ; then
  2030.  
  2031.         # Put a script in $SYMLINKSCRIPT that creates symbolic
  2032.         # links for all installed packages. Also, put a
  2033.         # script in the installscripts directory for each package which
  2034.         # can be run to create links for that package.
  2035.         # The "0" option below covers the $SYMLINKSCRIPT case.
  2036.         binlist=""
  2037.         uprfiles=""
  2038.         fonthome=""
  2039.         tfonthome="$NEWFONTHOME"
  2040.         if [ "$package_num" = 0 ] ; then
  2041.             scriptfile="$SYMLINKSCRIPT"
  2042.             # Construct a list of absolute paths to launch scripts.
  2043.             for package_num0 in ${PKGS_TO_INSTALL_TOTAL} ; do
  2044.                 pabbr0=`eval echo '$PKG_'$package_num0'_PKGABBR'`
  2045.                 pver0=`eval echo '$PKG_'$package_num0'_PKGVERS'`
  2046.                 package_dir0=$pabbr0"_"$pver0
  2047.                 fulldir0=$TOPDIR/$package_dir0
  2048.                 binlinks0=`eval echo '$PKG_'$package_num0'_BINLINKS'`
  2049.                 ntokens0=`echo $binlinks0 | wc -w`
  2050.                 if [ $ntokens0 -gt 0 ] ; then
  2051.                     for bin0 in $binlinks0 ; do
  2052.                         binlist="$binlist $fulldir0/$bin0"
  2053.                     done
  2054.                 fi
  2055.                 uprfile0=`eval echo '$PKG_'$package_num0'_FONTUPR'`
  2056.                 ftokens=`echo $uprfile0 | wc -w`
  2057.                 if [ $ftokens -gt 0 ] ; then
  2058.                     for upr0 in $uprfile0 ; do
  2059.                         uprfiles="$uprfiles $fulldir0/$upr0"
  2060.                     done
  2061.                 fi
  2062.                 fonthome0=`eval echo '$PKG_'$package_num0'_FONTDIR'`
  2063.                 newfonthome=`expr "$tfonthome" : '[ ]*\([^ ]*\)[ ]*'`
  2064.                 tfonthome=`expr "$tfonthome" : '[ ]*[^ ]*\(.*\)'`
  2065.                 if [ ! -z "$newfonthome" -a "$fonthome0" != "$newfonthome" ] ; then
  2066.                     fonthome0="$newfonthome"
  2067.                 fi
  2068.                 fonthome="$fonthome $fonthome0"
  2069.                 font_kbytes=`eval echo '$PKG_'$package_num0'_KBYTES'`
  2070.                 PERPKGFONTSIZE="$PERPKGFONTSIZE $font_kbytes"
  2071.             done
  2072.             MAKESCRIPT=1
  2073.             ONESCRIPT=1
  2074.             fulldir=$fulldir0
  2075.         else
  2076.             binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  2077.             ntokens=`echo $binlinks | wc -w`
  2078.             MAKESCRIPT=0
  2079.             if [ $ntokens -gt 0 ] ; then
  2080.                 scriptdir=$fulldir/installscripts
  2081.                 if [ ! -d "$scriptdir" ] ; then
  2082.                     $MKDIR $scriptdir
  2083.                     chmod a+rx $scriptdir
  2084.                 fi
  2085.                 scriptfile="$scriptdir"/makelinks
  2086.                 for bin in $binlinks ; do
  2087.                     binlist="$binlist $bin"
  2088.                 done
  2089.                 MAKESCRIPT=1
  2090.             fi
  2091.             fonthome=`eval echo '$PKG_'$package_num0'_FONTDIR'`
  2092.             newfonthome=`expr "$tfonthome" : '[ ]*\([^ ]*\)[ ]*'`
  2093.             tfonthome=`expr "$tfonthome" : '[ ]*[^ ]*\(.*\)'`
  2094.             if [ ! -z "$newfonthome" -a "$fonthome" != "$newfonthome" ] ; then
  2095.                 fonthome="$newfonthome"
  2096.             fi
  2097.             scriptdir=$fulldir/installscripts
  2098.             if [ ! -d "$scriptdir" ] ; then
  2099.                 $MKDIR $scriptdir
  2100.                 chmod a+rx $scriptdir
  2101.             fi
  2102.             scriptfile="$scriptdir"/makelinks
  2103.             uprfile=`eval echo '$PKG_'$package_num'_FONTUPR'`
  2104.             ftokens=`echo $uprfile | wc -w`
  2105.             if [ $ftokens -gt 0 ] ; then
  2106.                 for upr in $uprfile ; do
  2107.                     uprfiles="$uprfiles $upr"
  2108.                 done
  2109.                 MAKESCRIPT=1
  2110.             fi
  2111.             font_kbytes=`eval echo '$PKG_'$package_num'_KBYTES'`
  2112.             PERPKGFONTSIZE="$font_kbytes"
  2113.         fi
  2114.         if [ "$MAKESCRIPT" = 1 ] ; then
  2115.             echo '#!/bin/sh
  2116. # Shell script for automatically installing launch scripts and
  2117. # other small programs into an alternate launch script directory.' > "$scriptfile"
  2118.                         echo 'binlinks="'"$binlist"'"' >> "$scriptfile"
  2119.                         if [ $ANYFONTLINKS -eq 1 ] ; then
  2120.                             echo 'uprfiles="'"$uprfiles"'"' >> $scriptfile
  2121.                             echo 'fonthome="'"$fonthome"'"' >> $scriptfile
  2122.                             echo 'fontpattern="'"$FONTPATTERN"'"' >> $scriptfile
  2123.                             echo 'PSRES_PATH="'"$PSRES_PATH"'"' >> $scriptfile
  2124.                             echo 'USER_INFO_FILE="'"$USER_INFO_FILE"'"' >> $scriptfile
  2125.                             echo 'DOFONTLINKS=1' >> $scriptfile
  2126.                             echo 'DFCMD="'"$DFCMD"'"' >> $scriptfile
  2127.                             echo 'PERPKGFONTSIZE="'"$PERPKGFONTSIZE"'"' >> $scriptfile
  2128.                             echo 'KBYTES_AVAIL_FIELD="'"$KBYTES_AVAIL_FIELD"'"' >> $scriptfile
  2129.                         else
  2130.                             echo 'DOFONTLINKS=0' >> $scriptfile
  2131.                         fi
  2132.                         echo 'LOOP_LIMIT='$LOOP_LIMIT >> "$scriptfile"
  2133.                         echo 'defaultinstalldir="'"$fulldir"'"' >> "$scriptfile"
  2134.                         echo 'defaultdir="/usr/bin"
  2135. # For echo without newline under BSD, set EB and EE variables
  2136. osname="UNKNOWN"
  2137. osversion="UNKNOWN"
  2138. EB="-n "
  2139. EE=""
  2140. if [ -x /bin/uname ]
  2141. then
  2142.     osname=`/bin/uname -s`
  2143.         # 64 bit IRIX6 returns IRIX64 for uname -s
  2144.     firstfour=`echo "$osname" | sed -e '\''s/^\(....\).*$/\1/g'\''`
  2145.         if [ "$firstfour" = "IRIX" ]
  2146.     then
  2147.                 osname="IRIX"
  2148.         fi
  2149.     osversion=`/bin/uname -r`
  2150.     check=`echo "$osversion" | egrep '\''^[0-9]\.[0-9]*'\''`
  2151.     if [ "$check" != "" ]
  2152.     then
  2153.         # osmajorminor will be like "4.2". osmajor: "4". osminor:"2".
  2154.         osmajorminor=`echo "$osversion" | sed -e '\''s/^\([0-9]\.[0-9]\).*/\1/'\''`
  2155.         osmajor=`echo "$osversion" | sed -e '\''s/^\([0-9][0-9]*\).*/\1/'\''`
  2156.         osminor=`echo "$osversion" | sed -e '\''s/^[0-9]\.\([0-9][0-9]*\).*/\1/'\''`
  2157.     fi
  2158. fi
  2159. if [ $osname = "SunOS" ]
  2160. then
  2161.     STDBINDIR="/usr/bin"
  2162.     RETURNKEYNAME="Return"
  2163.     if [ $osmajor -ge 5 ]
  2164.     then
  2165.         # For echo without newline under Sys V, set EB and EE variables
  2166.         EB=""
  2167.         EE="'\\\\'c"
  2168.         PATH=/usr/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/openwin/bin:/sbin:/usr/sbin:/etc:/usr/etc
  2169.     else
  2170.         # For echo without newline under BSD, set EB and EE variables
  2171.         EB="-n "
  2172.         EE=""
  2173.         PATH=/usr/bin:/bin:/usr/bin/X11:/usr/openwin/bin:/sbin:/etc:/usr/etc
  2174.     fi
  2175.  
  2176. elif [ $osname = "IRIX" ]
  2177. then
  2178.     STDBINDIR="/usr/bin"
  2179.     RETURNKEYNAME="Enter"
  2180.     # For echo without newline under Sys V, set EB and EE variables
  2181.     EB=""
  2182.     EE="'\\\\'c"
  2183.     PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/bin/X11:/usr/openwin/bin:/etc:/usr/etc
  2184. elif [ $osname = "HP-UX" ]
  2185. then
  2186.     STDBINDIR="/bin"
  2187.     RETURNKEYNAME="Return"
  2188.     # For echo without newline under Sys V, set EB and EE variables
  2189.     EB=""
  2190.     EE="'\\\\'c"
  2191.     PATH=/usr/sbin:/sbin:/usr/bin:/bin:/usr/bin/X11:/etc:/usr/etc
  2192. fi
  2193. if [ "$osname" = "UNKNOWN" -o "$osversion" = "UNKNOWN" ]
  2194. then
  2195.     echo ""
  2196.     echo "Unrecognized operating system. Cannot make links."
  2197.     exit 1
  2198. fi
  2199. MKDIR="$STDBINDIR/mkdir -p "
  2200. RMDIR="$STDBINDIR/rmdir "
  2201. LN="$STDBINDIR/ln -s"
  2202. RM="$STDBINDIR/rm -f"
  2203. ECHO="$STDBINDIR/echo"
  2204. SED="$STDBINDIR/sed"
  2205. LS="$STDBINDIR/ls"
  2206. EXPR="$STDBINDIR/expr"
  2207. PWDPROG="$STDBINDIR/pwd"
  2208. DIRCP="$STDBINDIR/cp -pr"
  2209. DIRRM="$STDBINDIR/rm -rf"
  2210. CP="$STDBINDIR/cp"
  2211. CD="cd"
  2212. CAT="$STDBINDIR/cat"
  2213. installdir="$defaultinstalldir"
  2214.  
  2215. umask 22
  2216.  
  2217. # Try to determine the parent directory to this launch script.
  2218. # Follow any symbolic links in thisscriptname.
  2219. thisscriptname=$0
  2220. while :
  2221. do
  2222.     lsresult=`$LS -l $thisscriptname`
  2223.     symlink=`$EXPR "$lsresult" : '\''.*>'\''.*`
  2224.     if [ "$symlink" -gt 0 ]
  2225.     then
  2226.         oldscriptname="$thisscriptname"
  2227.         thisscriptname=`$ECHO $lsresult|$SED -e '\''s/^.*-> *\(.*\) *$/\1/g'\''`
  2228.         abspath_new=`$EXPR "$thisscriptname" : '\''^/'\''`
  2229.         if [ $abspath_new != 1 ]
  2230.         then
  2231.             abspath_old=`$EXPR "$oldscriptname" : '\''^/'\''`
  2232.             if [ $abspath_old != 1 ]
  2233.             then
  2234.                 olddir=`$PWDPROG`
  2235.             else
  2236.                 olddir=`$EXPR "$oldscriptname" : '\''\(.*\)/'\''` 
  2237.             fi
  2238.             thisscriptname="$olddir/$thisscriptname"
  2239.         fi
  2240.     else
  2241.         break
  2242.     fi
  2243. done
  2244. # Determine directory containing this shell script.
  2245. scriptdir=`$EXPR $thisscriptname : '\''\(.*\)/'\''` 
  2246. if [ "$scriptdir" = "" -o "$scriptdir" = "." ]
  2247. then
  2248.     scriptdir=`$PWDPROG`
  2249. fi
  2250. # If scriptdir is /tmp, then do not try to override defaultdir.
  2251. if [ "$scriptdir" != "/tmp" ]
  2252. then
  2253.     # Determine root directory for installation ($scriptdir/..).
  2254.     parentdir=`$EXPR $scriptdir : '\''\(.*\)/'\''` 
  2255.     if [ "$parentdir" != "" ]
  2256.     then
  2257.         installdir="$parentdir"
  2258.     fi
  2259. fi
  2260. echo ""
  2261. echo ""
  2262. echo "Enter the full path of the directory into which you want to create"
  2263. echo "symbolic links for programs and/or scripts"
  2264. echo $EB"[Press $RETURNKEYNAME for /usr/bin]: "$EE
  2265. read launchdir
  2266. if [ "$launchdir" = "" ] 
  2267. then
  2268.     launchdir="$defaultdir"
  2269. fi
  2270. if [ ! -d "$launchdir"  ] 
  2271. then
  2272.     if $MKDIR $launchdir
  2273.     then error=0
  2274.     else error=1
  2275.     fi
  2276.     if [ $error != 0  ]
  2277.     then
  2278.         echo "Cannot create directory $launchdir"
  2279.         echo "You must choose different options or change permissions"
  2280.         echo "and then rerun this script."
  2281.         exit 1
  2282.     fi
  2283.     chmod u+w "$launchdir"
  2284.     chmod a+rx "$launchdir"
  2285. fi
  2286. if [ ! -w $launchdir ]
  2287. then
  2288.     echo ""
  2289.     echo ""
  2290.     echo "You do not have permission to write to $launchdir."
  2291.     echo "You must choose different options or change permissions"
  2292.     echo "and then rerun this script."
  2293.     exit 1
  2294. fi
  2295. makelinks_loop=0
  2296. while :
  2297. do
  2298.     makelinks_loop=`expr $makelinks_loop + 1`
  2299.     if [ $makelinks_loop -ge $LOOP_LIMIT ]
  2300.     then
  2301.         echo ""
  2302.         echo "LOOP_LIMIT exceeded."
  2303.         exit 1
  2304.     fi
  2305.     echo ""
  2306.     echo ""
  2307.     echo "This script will issue the following commands to install the"
  2308.     echo "programs and/or scripts:"
  2309.     echo ""
  2310.     for bin in $binlinks ; do
  2311.         # Next line extracts filename from full path
  2312.         name=`expr //$bin : '\''.*/\(.*\)'\''`
  2313.         abspath_bin=`$EXPR "$bin" : '\''^/'\''`
  2314.         if [ $abspath_bin != 1 ] ; then
  2315.             echo ${LN} "$installdir/$bin" "$launchdir/$name"
  2316.         else
  2317.             echo ${LN} "$bin" "$launchdir/$name"
  2318.         fi
  2319.     done
  2320.     echo ""
  2321.     echo $EB"OK to proceed (YES/NO)? "$EE
  2322.     read A
  2323.     if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  2324.         break
  2325.     elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  2326.         DOSYMLINKS=0
  2327.         echo "Installation of programs and/or scripts cancelled."
  2328.         exit 1
  2329.     else
  2330.         echo ""
  2331.         echo "You must specify YES or NO.  Try again."
  2332.     fi
  2333. done
  2334.  
  2335. #BEGIN link_loop_func
  2336.     funclist="$binlinks"
  2337.     funcdir="$installdir"
  2338.     for bin in $funclist ; do
  2339.         # Next line extracts filename from full path
  2340.         name=`expr //$bin : '\''.*/\(.*\)'\''`
  2341.         if [ -f "$launchdir/$name" -o -d "$launchdir/$name" -o -h "$launchdir/$name" ]
  2342.         then
  2343.             overwritelink_loop=0
  2344.             while :
  2345.             do
  2346.                 overwritelink_loop=`expr $overwritelink_loop + 1`
  2347.                 if [ $overwritelink_loop -ge $LOOP_LIMIT ] ; then
  2348.                     echo ""
  2349.                     echo "LOOP_LIMIT exceeded."
  2350.                     eval ${ABORTCMD}
  2351.                 fi
  2352.                 echo ""
  2353.                 echo "File $launchdir/$name already exists. OK to replace"
  2354.                 echo $EB"(YES/NO)? "$EE
  2355.                 read A
  2356.                 if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  2357.                     ${RM} "$launchdir/$name"
  2358.                     abspath_bin=`expr "$bin" : '\''^/'\''`
  2359.                     if [ $abspath_bin != 1 ] ; then
  2360.                         ${LN} "$funcdir/$bin" "$launchdir/$name"
  2361.                     else
  2362.                         ${LN} "$bin" "$launchdir/$name"
  2363.                     fi
  2364.                     break
  2365.                 elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  2366.                     break
  2367.                 else
  2368.                     echo ""
  2369.                     echo "You must specify YES or NO.  Try again."
  2370.                 fi
  2371.             done
  2372.         else
  2373.             abspath_bin=`expr "$bin" : '\''^/'\''`
  2374.             if [ $abspath_bin != 1 ] ; then
  2375.                 ${LN} "$funcdir/$bin" "$launchdir/$name"
  2376.             else
  2377.                 ${LN} "$bin" "$launchdir/$name"
  2378.             fi
  2379.         fi
  2380.     done
  2381. #END link_loop_func
  2382.  
  2383. echo ""
  2384. echo ""
  2385. echo "Installation of programs and/or scripts successful."
  2386. echo ""
  2387.  
  2388. if [ $DOFONTLINKS -eq 1 ] ; then
  2389.     while : ; do
  2390.         CREATED=0
  2391.         DOFONTLINKS=0
  2392.         NCNT=1
  2393.         newfonthome=""
  2394.         FLOK=1
  2395.         fontsize=$PERPKGFONTSIZE
  2396.         for fonth in $fonthome ; do
  2397.             # WARNING: This prompt does not account for $NCNT packages.  It will appear to ask the same question over and over.
  2398.             echo ""
  2399.             echo "Enter the full path of the directory in which you want"
  2400.             echo "applications to look for fonts, or press $RETURNKEYNAME to accept"
  2401.             echo "the default directory.  The directory will be created if it does"
  2402.             echo "not exist."
  2403.             echo $EB"[Press $RETURNKEYNAME for $fonth]: "$EE
  2404.             read launchdir
  2405.             if [ "$launchdir" = "" ] 
  2406.             then
  2407.                 launchdir="$fonth"
  2408.             fi
  2409.             if [ ! -d "$launchdir"  ] 
  2410.             then
  2411.                 if $MKDIR $launchdir
  2412.                 then error=0
  2413.                 else error=1
  2414.                 fi
  2415.                 if [ $error != 0  ]
  2416.                 then
  2417.                     echo "Cannot create directory $launchdir"
  2418.                     echo "You must choose different options or change permissions"
  2419.                     echo "and then rerun this script."
  2420.                     exit 1
  2421.                 fi
  2422.                 chmod u+w "$launchdir"
  2423.                 chmod a+rx "$launchdir"
  2424.                 CREATED=1
  2425.             fi
  2426.             if [ ! -w $launchdir ]
  2427.             then
  2428.                 echo ""
  2429.                 echo ""
  2430.                 echo "You do not have permission to write to $launchdir."
  2431.                 echo "You must choose different options or change permissions"
  2432.                 echo "and then rerun this script."
  2433.                 exit 1
  2434.             fi
  2435.             # Get last line of df statement.
  2436.             # Prepend X because if the mount point is too long,
  2437.             # the df command will result in two lines, with the
  2438.             # second line having blanks for the first field.
  2439.             lastdfline="X"`$DFCMD $launchdir | sed -n '\''$p'\''`
  2440.     
  2441.             # Determine if there is enough disk space for this install.
  2442.             case $KBYTES_AVAIL_FIELD in
  2443.                 1)
  2444.                     disk_kbytes=`echo $lastdfline | awk '\''{ print $1 }'\''`
  2445.                     ;;
  2446.                 2)
  2447.                     disk_kbytes=`echo $lastdfline | awk '\''{ print $2 }'\''`
  2448.                     ;;
  2449.                 3)
  2450.                     disk_kbytes=`echo $lastdfline | awk '\''{ print $3 }'\''`
  2451.                     ;;
  2452.                 4)
  2453.                     disk_kbytes=`echo $lastdfline | awk '\''{ print $4 }'\''`
  2454.                     ;;
  2455.                 5)
  2456.                     disk_kbytes=`echo $lastdfline | awk '\''{ print $5 }'\''`
  2457.                     ;;
  2458.                 *)
  2459.                     echo ""
  2460.                     echo "Internal error. Unable to determine disk space."
  2461.                     eval ${ABORTCMD}
  2462.                     ;;
  2463.             esac
  2464.             font_kbytes=`expr "$fontsize" : '\''[ ]*\([^ ]*\)'\''`
  2465.             fontsize=`expr "$fontsize" : '\''[ ]*[^ ]*\(.*\)'\''`
  2466.             if [ $font_kbytes -ge $disk_kbytes ] ; then
  2467.                 echo ""
  2468.                 echo ""
  2469.                 echo "There is not enough disk space for the fonts."
  2470.                 echo "The installation you requested requires $font_kbytes kilobytes of disk space"
  2471.                 echo "and you currently have only $disk_kbytes kilobytes of available disk space"
  2472.                 echo "in directory $launchdir."
  2473.                 echo ""
  2474.                 echo "Choose a different location to install the fonts."
  2475.                 echo ""
  2476.                 echo ""
  2477.                 echo "Press $RETURNKEYNAME to continue"
  2478.                 read A
  2479.                 FLOK=0
  2480.                 break
  2481.             fi
  2482.             newfonthome="$newfonthome $launchdir"
  2483.         done
  2484.         if [ $FLOK -eq 1 ] ; then
  2485.             break
  2486.         fi
  2487.     done # while
  2488.     makelinks_loop=0
  2489.     while :
  2490.     do
  2491.         makelinks_loop=`expr $makelinks_loop + 1`
  2492.         if [ $makelinks_loop -ge $LOOP_LIMIT ]
  2493.         then
  2494.             echo ""
  2495.             echo "LOOP_LIMIT exceeded."
  2496.             exit 1
  2497.         fi
  2498.         echo ""
  2499.         echo ""
  2500.         echo "This script will issue the following commands to install the"
  2501.         echo "fonts:"
  2502.         echo ""
  2503.         tfonthome=$newfonthome
  2504.         tuprfiles=$uprfiles
  2505.         for fonth in $newfonthome ; do
  2506.             echo "${DIRCP} $installdir/$fontpattern $fonth"
  2507.             #echo "${DIRRM} $installdir/$fontpattern"
  2508.             uprf=`expr "$tuprfiles" : '\''[ ]*\([^ ]*\)[ ]*'\''`
  2509.             tuprfiles=`expr "$tuprfiles" : '\''[ ]*[^ ]*\(.*\)'\''`
  2510.             if [ ! -z "$uprf" ] ; then
  2511.                 name=`expr //$uprf : '\''.*/\(.*\)'\''`
  2512.                 if [ -z "$name" ] ; then
  2513.                     name="$uprf"
  2514.                 fi
  2515.                 abspath_bin=`expr "$uprf" : '\''^/'\''`
  2516.                 udir=`expr "$fonth" : '\''\(.*\)/'\''`
  2517.                 if [ $abspath_bin != 1 ] ; then
  2518.                     dir=`expr "$fontpattern" : '\''\(.*\)/'\''`
  2519.                     if [ -z "$dir" ] ; then
  2520.                         echo ${CP} "$installdir/$uprf" "$udir/$name"
  2521.                     else
  2522.                         echo ${CP} "$installdir/$dir/$uprf" "$udir/$name"
  2523.                     fi
  2524.                 else
  2525.                     echo ${CP} "$uprf" "$udir/$name"
  2526.                 fi
  2527.             fi
  2528.             # X font info files
  2529.             fdir=`expr "$fontpattern" : '\''\(.*\)/'\''`
  2530.             if [ -f $installdir/$fdir/fonts.dir ] ; then
  2531.                 echo ${CP} $installdir/$fdir/fonts.dir $fonth
  2532.             fi
  2533.             if [ -f $installdir/$fdir/fonts.alias ] ; then
  2534.                 echo ${CP} $installdir/$fdir/fonts.alias $fonth
  2535.             fi
  2536.         done
  2537.         for fonth in $newfonthome ; do
  2538.             if [ -d $fonth ] ; then
  2539.                 if [ $CREATED -ne 1 ] ; then
  2540.                 while : ; do
  2541.                     echo ""
  2542.                     echo ""
  2543.                     echo "*** Warning ***"
  2544.                     echo "Some fonts are already installed in $fonth.  This script"
  2545.                     echo "checks the name of each font to be installed against those already"
  2546.                     echo "installed in $fonth.  You may choose to skip the"
  2547.                     echo "installation of fonts whose names match, or you may replace matching"
  2548.                     echo "fonts.  Fonts with no matching name will be installed regardless."   
  2549.                     echo ""
  2550.                     echo $EB"Do you want to replace fonts with matching names (YES/NO)? "$EE
  2551.                     read A
  2552.                     if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" -o "$A" = ""  ] ; then
  2553.                         SKIPFONTS=0
  2554.                         break
  2555.                     elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  2556.                         SKIPFONTS=1
  2557.                         break
  2558.                     else
  2559.                         echo ""
  2560.                         echo "You must specify YES or NO.  Try again."
  2561.                     fi
  2562.                 done
  2563.                 fi
  2564.             fi
  2565.         done
  2566.         echo ""
  2567.         echo $EB"OK to proceed (YES/NO)? "$EE
  2568.         read A
  2569.         if [ "$A" = "YES" -o "$A" = "Y" -o "$A" = "yes" -o "$A" = "y" -o "$A" = "Yes" ] ; then
  2570.             DOFONTLINKS=1
  2571.             break
  2572.         elif [ "$A" = "NO" -o "$A" = "N" -o "$A" = "no" -o "$A" = "n" -o "$A" = "No" ] ; then
  2573.             DOFONTLINKS=0
  2574.             echo "Installation of fonts cancelled."
  2575.             break
  2576.         else
  2577.             echo ""
  2578.             echo "You must specify YES or NO.  Try again."
  2579.         fi
  2580.     done
  2581.     
  2582.     if [ $DOFONTLINKS -eq 1 ] ; then
  2583.         echo ""
  2584.         tuprfiles=$uprfiles
  2585.         fdir=`expr "$fontpattern" : '\''\(.*\)/'\''`
  2586.         fpat=`expr "//$fontpattern" : '\''.*/\(.*\)'\''`
  2587.         ferrs=""
  2588.         fudirs=""
  2589.         for fonth in $newfonthome ; do
  2590.             # must list each subdirectory
  2591.             allfonts="`(cd $installdir/$fdir ; echo $fpat)`"
  2592.             for font in $allfonts ; do
  2593.                 if [ -d "$fonth/$font" ] ; then
  2594.                     if [ $SKIPFONTS -eq 1 ] ; then
  2595.                         echo "Skipping $font"
  2596.                         continue
  2597.                     else
  2598.                         if ${DIRRM} $fonth/$font ; then
  2599.                             echo "Replacing $font"
  2600.                         else
  2601.                             echo "Could not replace $font"
  2602.                             ferrs="$ferrs $font"
  2603.                             continue
  2604.                         fi
  2605.                     fi
  2606.                 fi
  2607.                 if ${DIRCP} $installdir/$fdir/$font $fonth ; then
  2608.                     # ${DIRRM} $installdir/$fdir/$font
  2609.                     :
  2610.                 else
  2611.                     ferrs="$ferrs $font"
  2612.                 fi
  2613.             done
  2614.             # X font info files
  2615.             for fxinfo in fonts.dir fonts.alias ; do
  2616.                 if [ -f $installdir/$fdir/$fxinfo ] ; then
  2617.                     if [ -f $fonth/$fxinfo ] ; then
  2618.                         echo "    *** Warning ***"
  2619.                         echo "    Cannot copy new $fxinfo to destination directory."
  2620.                         echo "    $fonth/$fxinfo already exists.  The new file will"
  2621.                         echo "    be left in $installdir/$fdir/$fxinfo."
  2622.                         echo "    You will have to merge the files manually."
  2623.                     else
  2624.                         ${CP} $installdir/$fdir/$fxinfo $fonth
  2625.                     fi
  2626.                 fi
  2627.             done
  2628.             # UPR Files
  2629.             uprf=`expr "$tuprfiles" : '\''[ ]*\([^ ]*\)[ ]*'\''`
  2630.             tuprfiles=`expr "$tuprfiles" : '\''[ ]*[^ ]*\(.*\)'\''`
  2631.             udir=`expr "$fonth" : '\''\(.*\)/'\''`
  2632.             if [ -z "$udir" ] ; then
  2633.                 udir="$fonth"
  2634.             fi
  2635.             fudirs="$fudirs $udir"
  2636.             if [ ! -z "$uprf" ] ; then
  2637.                 name=`expr //$uprf : '\''.*/\(.*\)'\''`
  2638.                 if [ -z "$name" ] ; then
  2639.                     name="$uprf"
  2640.                 fi
  2641.                 if [ -f "$udir/$name" -o -h "$udir/$name" ] ; then
  2642.                     nf=1
  2643.                     nfxxx=`echo $nf | awk '\''{printf "%03d", $1 }'\''`
  2644.                     newname="`echo $name | sed -e s/.upr/_${nfxxx}.upr/`"
  2645.                     while [ -f "$udir/$newname" -o -h "$udir/$newname" ] ; do
  2646.                         newname="`echo $newname | sed -e s/_${nfxxx}.upr/.upr/`"
  2647.                         nf=`expr $nf + 1`
  2648.                         nfxxx=`echo $nf | awk '\''{printf "%03d", $1 }'\''`
  2649.                         newname="`echo $newname | sed -e s/.upr/_${nfxxx}.upr/`"
  2650.                     done
  2651.                     echo "$udir/$name already exists."
  2652.                     echo "The new resource file will be added to the directory with"
  2653.                     echo "the new name $newname."
  2654.                     name="$newname"
  2655.                 fi
  2656.                 abspath_bin=`expr "$uprf" : '\''^/'\''`
  2657.                 if [ $abspath_bin != 1 ] ; then
  2658.                     ${CP} "$installdir/$uprf" "$udir/$name"
  2659.                 else
  2660.                     ${CP} "$uprf" "$udir/$name"
  2661.                 fi
  2662.             fi
  2663.         done
  2664.         # Concatanate final psresourcepath
  2665.         resdir=""
  2666.         for udir in $fudirs ; do
  2667.             resdir="$resdir $udir"
  2668.         done
  2669.         if [ ! -z "$HOME" ] ; then
  2670.             PSRES_PATH="`echo $PSRES_PATH | $SED -e s%$HOME/psres%'\''$HOME/psres'\''%`"
  2671.         fi
  2672.  
  2673.         psres="`echo $PSRES_PATH | tr : '\'' '\''`"
  2674.         for udir in $resdir ; do
  2675.             needit=1
  2676.             for oldudir in $psres ; do
  2677.                 if [ "$udir" = "$oldudir" -o "$udir" = "$HOME/psres" ] ; then
  2678.                     needit=0
  2679.                     break
  2680.                 fi
  2681.             done
  2682.             if [ $needit -eq 1 ] ; then
  2683.                 PSRES_PATH="$udir:$PSRES_PATH"
  2684.             fi
  2685.         done
  2686.         # Determine parent dir for psres_file and make, if necessary.
  2687.         abspath=`expr $USER_INFO_FILE : '\''^/'\''`
  2688.         if [ $abspath = 1 ] ; then
  2689.             user_file="$USER_INFO_FILE"
  2690.         else
  2691.             user_file="$installdir/$USER_INFO_FILE"
  2692.         fi
  2693.         # Determine parent dir for psres_file and make, if necessary.
  2694.         dir=`expr "$user_file" : '\''\(.*\)/'\''`
  2695.         if [ ! -d "$dir" ] ; then
  2696.             $MKDIR $dir
  2697.             chmod u+w $dir
  2698.             chmod a+rx $dir
  2699.         fi
  2700.         $RM -f "$user_file"
  2701.         $CAT << INHERE > "$user_file"
  2702. # USER INFORMATION FILE FOR ADOBE SOFTWARE
  2703. #
  2704. # Adobe software has been installed at your site.  To use it
  2705. # you must add the following configuration information to your
  2706. # environment (typically .login or .cshrc file).
  2707. #
  2708. # PostScript Resources
  2709. # Add the following directories to your PSRESOURCEPATH, and make
  2710. # sure that your PSRESOURCEPATH definition ends with "::"
  2711. #    $PSRES_PATH
  2712. #
  2713. # For example, try the following if you use csh:
  2714. setenv PSRESOURCEPATH $PSRES_PATH::
  2715. #
  2716. # Some applications, such as Adobe Illustrator 5.5, provide
  2717. # a file called SITE_PSRESOURCEPATH, where the directories
  2718. # listed above can be included for all users of the application,
  2719. # so that individual modification of PSRESOURCEPATH is not
  2720. # required.  All that is required is the use of "::", or
  2721. # for PSRESOURCEPATH to be left undefined.  See your application
  2722. # user'\''s manual for details.
  2723. #
  2724. # Some applications have the directories:
  2725. #    \$HOME/psres:/usr/psres
  2726. # as their built-in locations.  These are the standard locations
  2727. # recommended by Adobe.  If your application supports the standard
  2728. # locations, no modification or definition of PSRESOURCEPATH is
  2729. # required.
  2730. #
  2731. INHERE
  2732.         echo ""
  2733.         name=`expr //$user_file : '\''.*/\(.*\)'\''`
  2734.         echo "********************* IMPORTANT *********************"
  2735.         echo '\''A customized file "'\''$name'\''", which describes environment'\''
  2736.         echo "settings that are essential for using the fonts you have"
  2737.         echo "just installed, has been stored in"
  2738.         echo "$dir.  Please distribute this"
  2739.         echo "file to any users of these fonts."
  2740.         echo ""
  2741.         if [ ! -z "$ferrs" ] ; then
  2742.             echo ""
  2743.             echo "***** NOTICE *****"
  2744.             echo "The following fonts have been left in the installation"
  2745.             echo "directory, because they did not install properly:"
  2746.             for fff in $ferrs ; do
  2747.                 echo "  $fff"
  2748.             done
  2749.             echo ""
  2750.         else
  2751.             echo ""
  2752.             echo ""
  2753.             echo "Installation of fonts successful."
  2754.             echo ""
  2755.         fi
  2756.     fi 
  2757. fi
  2758.  
  2759. echo ""
  2760. echo ""
  2761. echo "*** Installation complete ***"
  2762. echo ""
  2763.  
  2764. ' >> "$scriptfile"
  2765.             chmod 555 "$scriptfile"
  2766.         fi
  2767.     fi
  2768.  
  2769.     # Skip the rest of the processing for package_num = 0
  2770.     if [ "$package_num" = 0 ] ; then
  2771.         continue
  2772.     fi
  2773.  
  2774.     if [ ! -d ${fulldir} ] ; then
  2775.         echo ""
  2776.         echo $EB"Your "$EE
  2777.         if [ $USECD = 1 ] ; then
  2778.             echo $EB"CD-ROM "$EE
  2779.         else
  2780.             echo $EB"tape "$EE
  2781.         fi
  2782.         if [ "$RHOST" = "" ] ; then
  2783.            echo "could not be read from $DEVPATH."
  2784.         else
  2785.            echo "could not be read from $DEVPATH on $RHOST."
  2786.         fi
  2787.         eval "${RM} ${FILELIST}"
  2788.         eval ${ABORTCMD}
  2789.     fi
  2790.  
  2791.     # Force proper permissions.
  2792.     # Comment out for now. Assume permissions were set properly
  2793.     # when application created the tree for each package.
  2794.     #find $fulldir -type f -exec chmod a+r,a-w {} \;
  2795.     #find $fulldir -type d -exec chmod 755 {} \;
  2796.     #chown -Rf root.staff $fulldir
  2797.  
  2798.     # Establish automatic symbolic links if so desired.
  2799.     if [ $DOSYMLINKS = 1 ] ; then
  2800.         binlinks=`eval echo '$PKG_'$package_num'_BINLINKS'`
  2801.         ntokens=`echo $binlinks | wc -w`
  2802.         if [ $ntokens -gt 0 ] ; then
  2803.             for bin in $binlinks ; do
  2804.                 # Next line is equiv to csh: set name=$bin:t
  2805.                 name=`expr //$bin : '.*/\(.*\)'`
  2806.                 ${RM} -f $AUTOSYMLINKDIR/$name
  2807.                 ${LN} $fulldir/$bin $AUTOSYMLINKDIR/$name
  2808.             done
  2809.         fi
  2810.     fi
  2811.  
  2812.     # Automatically move fonts if so desired.
  2813.     if [ $DOFONTLINKS = 1 ] ; then
  2814.         fonthome=$NEWFONTHOME
  2815.         tuprfiles=$uprfiles
  2816.         fdir=`expr "$FONTPATTERN" : '\(.*\)/'`
  2817.         fpat=`expr "//$FONTPATTERN" : '.*/\(.*\)'`
  2818.         ferrs=""
  2819.         FONTUDIRS=""
  2820.         for fonth in $fonthome ; do
  2821.             # must list each subdirectory
  2822.             allfonts="`(cd $fulldir/$fdir ; echo $fpat)`"
  2823.             for font in $allfonts ; do
  2824.                 if [ -d "$fonth/$font" ] ; then
  2825.                     if [ $SKIPFONTS -eq 1 ] ; then
  2826.                         echo "Skipping $font"
  2827.                         continue
  2828.                     else
  2829.                         if ${DIRRM} $fonth/$font ; then
  2830.                             echo "Replacing $font"
  2831.                         else
  2832.                             echo "Could not replace $font"
  2833.                             ferrs="$ferrs $font"
  2834.                             continue
  2835.                         fi
  2836.                     fi
  2837.                 fi
  2838.                 if ${DIRCP} $fulldir/$fdir/$font $fonth ; then
  2839.                     ${DIRRM} $fulldir/$fdir/$font
  2840.                     :
  2841.                 else
  2842.                     ferrs="$ferrs $font"
  2843.                 fi
  2844.             done
  2845.             # X font info files
  2846.             for fxinfo in fonts.dir fonts.alias ; do
  2847.                 if [ -f $fulldir/$fdir/$fxinfo ] ; then
  2848.                     if [ -f $fonth/$fxinfo ] ; then
  2849.                         echo "    *** Warning ***"
  2850.                         echo "    Cannot copy new $fxinfo to destination directory."
  2851.                         echo "    $fonth/$fxinfo already exists.  The new file will"
  2852.                         echo "    be left in $fulldir/$fdir/$fxinfo."
  2853.                         echo "    You will have to merge the files manually."
  2854.                     else
  2855.                         ${CP} $fulldir/$fdir/$fxinfo $fonth
  2856.                     fi
  2857.                 fi
  2858.             done
  2859.             # UPR files
  2860.             uprf=`expr "$tuprfiles" : '[ ]*\([^ ]*\)[ ]*'`
  2861.             tuprfiles=`expr "$tuprfiles" : '[ ]*[^ ]*\(.*\)'`
  2862.             udir=`expr "$fonth" : '\(.*\)/'`
  2863.             if [ -z "$udir" ] ; then
  2864.                 udir="$fonth"
  2865.             fi
  2866.             FONTUDIRS="$FONTUDIRS $udir"
  2867.             if [ ! -z "$uprf" ] ; then
  2868.                 name=`expr //$uprf : '.*/\(.*\)'`
  2869.                 if [ -z "$name" ] ; then
  2870.                     name="$uprf"
  2871.                 fi
  2872.                 if [ -f "$udir/$name" -o -h "$udir/$name" ] ; then
  2873.                     nf=1
  2874.                     nfxxx=`echo $nf | awk '{printf "%03d", $1 }'`
  2875.                     newname="`echo $name | sed -e s/.upr/_${nfxxx}.upr/`"
  2876.                     while [ -f "$udir/$newname" -o -h "$udir/$newname" ] ; do
  2877.                         newname="`echo $newname | sed -e s/_${nfxxx}.upr/.upr/`"
  2878.                         nf=`expr $nf + 1`
  2879.                         nfxxx=`echo $nf | awk '{printf "%03d", $1 }'`
  2880.                         newname="`echo $newname | sed -e s/.upr/_${nfxxx}.upr/`"
  2881.                     done
  2882.                     echo "$udir/$name already exists."
  2883.                     echo "The new resource file will be added to the directory with"
  2884.                     echo "the new name $newname."
  2885.                     name="$newname"
  2886.                 fi
  2887.                 abspath_bin=`expr "$uprf" : '^/'`
  2888.                 if [ $abspath_bin != 1 ] ; then
  2889.                     ${CP} "$fulldir/$uprf" "$udir/$name"
  2890.                 else
  2891.                     ${CP} "$uprf" "$udir/$name"
  2892.                 fi
  2893.             fi
  2894.         done
  2895.         # Concatanate final psresourcepath
  2896.         resdir=""
  2897.         for udir in $FONTUDIRS ; do
  2898.             resdir="$resdir $udir"
  2899.         done
  2900.         if [ ! -z "$HOME" ] ; then
  2901.             PSRES_PATH="`echo $PSRES_PATH | $SED -e s%$HOME/psres%'$HOME/psres'%`"
  2902.         fi
  2903.         psres="`echo $PSRES_PATH | tr : ' '`"
  2904.         for udir in $resdir ; do
  2905.             needit=1
  2906.             for oldudir in $psres ; do
  2907.                 if [ "$udir" = "$oldudir" -o "$udir" = "$HOME/psres" ] ; then
  2908.                     needit=0
  2909.                     break
  2910.                 fi
  2911.             done
  2912.             if [ $needit -eq 1 ] ; then
  2913.                 PSRES_PATH="$udir:$PSRES_PATH"
  2914.             fi
  2915.         done
  2916.         # Determine parent dir for psres_file and make, if necessary.
  2917.         abspath=`expr $USER_INFO_FILE : '^/'`
  2918.         if [ $abspath = 1 ] ; then
  2919.             user_file="$USER_INFO_FILE"
  2920.         else
  2921.             user_file="$fulldir/$USER_INFO_FILE"
  2922.         fi
  2923.         # Determine parent dir for psres_file and make, if necessary.
  2924.         dir=`expr "$user_file" : '\(.*\)/'`
  2925.         if [ ! -d "$dir" ] ; then
  2926.             $MKDIR $dir
  2927.             chmod u+w $dir
  2928.             chmod a+rx $dir
  2929.         fi
  2930.         $RM -f "$user_file"
  2931.         $CAT << INHERE > "$user_file"
  2932. # USER INFORMATION FILE FOR ADOBE SOFTWARE
  2933. #
  2934. # Adobe software has been installed at your site.  To use it
  2935. # you must add the following configuration information to your
  2936. # environment (typically .login or .cshrc file).
  2937. #
  2938. # PostScript Resources
  2939. # Add the following directories to your PSRESOURCEPATH, and make
  2940. # sure that your PSRESOURCEPATH definition ends with "::"
  2941. #    $PSRES_PATH
  2942. #
  2943. # For example, try the following if you use csh:
  2944. setenv PSRESOURCEPATH $PSRES_PATH::
  2945. #
  2946. # Some applications, such as Adobe Illustrator 5.5, provide
  2947. # a file called SITE_PSRESOURCEPATH, where the directories
  2948. # listed above can be included for all users of the application,
  2949. # so that individual modification of PSRESOURCEPATH is not
  2950. # required.  All that is required is the use of "::", or
  2951. # for PSRESOURCEPATH to be left undefined.  See your application
  2952. # user's manual for details.
  2953. #
  2954. # Some applications have the directories:
  2955. #    \$HOME/psres:/usr/psres
  2956. # as their built-in locations.  These are the standard locations
  2957. # recommended by Adobe.  If your application supports the standard
  2958. # locations, no modification or definition of PSRESOURCEPATH is
  2959. # required.
  2960. #
  2961. INHERE
  2962.         echo ""
  2963.         name=`expr //$user_file : '.*/\(.*\)'`
  2964.         echo "********************* IMPORTANT *********************"
  2965.         echo 'A customized file "'$name'", which describes environment'
  2966.         echo "settings that are essential for using the fonts you have"
  2967.         echo "just installed, has been stored in"
  2968.         echo "$dir.  Please distribute this"
  2969.         echo "file to any users of these fonts."
  2970.         echo ""
  2971.         if [ ! -z "$ferrs" ] ; then
  2972.             echo ""
  2973.             echo "***** NOTICE *****"
  2974.             echo "The following fonts have been left in the installation"
  2975.             echo "directory, because they did not install properly:"
  2976.             for fff in $ferrs ; do
  2977.                 echo "  $fff"
  2978.             done
  2979.             echo ""
  2980.         fi
  2981.     fi
  2982.  
  2983.     # Put addlicense and requestlicense scripts in correct place.
  2984.     lmfeature=`eval echo '$PKG_'$package_num'_LMFEATURE'`
  2985.     lmversion=`eval echo '$PKG_'$package_num'_LMVERSION'`
  2986.     lmquotes=`eval echo '$PKG_'$package_num'_LMQUOTES'`
  2987.     pkgdesc=`eval echo '$PKG_'$package_num'_PKGDESC'`
  2988.     pkgvers=`eval echo '$PKG_'$package_num'_PKGVERS'`
  2989.     ntokens=`echo $lmfeature | wc -w`
  2990.     if [ $ntokens -gt 0 ] ; then
  2991.         licensedir=$fulldir/installscripts
  2992.         if [ ! -d "$licensedir" ] ; then
  2993.             $MKDIR "$licensedir"
  2994.         fi
  2995.         num=1
  2996.         while [ $num -le $ntokens ] ; do
  2997.             lmfeat=`eval 'echo $lmfeature | awk '\''{ print $'$num' }'\'`
  2998.             lmvers=`eval 'echo $lmversion | awk '\''{ print $'$num' }'\'`
  2999.             lmquot=`eval 'echo $lmquotes | awk '\''{ print $'$num' }'\'`
  3000.             already_lmfeat=`echo $LMFEATURELIST | grep '^'"$lmfeat"'$'`
  3001.             # Skip this if this feature has already been processed.
  3002.             if [ "$already_lmfeat" != "" ] ; then
  3003.                 break
  3004.             fi
  3005.             LMFEATURELIST=$LMFEATURELIST$lmfeat'
  3006. '
  3007.  
  3008.             # Copy addlicense script to ./installscripts and
  3009.             # automatically make changes in place.
  3010.             addlicensefname="$licensedir/$lmfeat"'.addlicense'
  3011.             if [ -f "$addlicensefname" ] ; then
  3012.                 licensefname="$SECURITYFILE"
  3013.                 $CAT "$addlicensefname" \
  3014.                 | sed 's%^LM_LICENSE_FILE=""$%LM_LICENSE_FILE="'$licensefname'"%' \
  3015.                 | sed 's%^LM_REF_FILE=""$%LM_REF_FILE="'$LM_FILE'"%' \
  3016.                 | sed 's%^LM_DAEMON_DIR=""$%LM_DAEMON_DIR="'$DAEMONDIR'"%' \
  3017.                 | sed 's%^LM_FEATURE=""$%LM_FEATURE="'$lmfeat'"%' \
  3018.                 | sed 's%^LM_VERSION=""$%LM_VERSION="'$lmvers'"%' \
  3019.                 | sed 's%^LM_QUOTES=""$%LM_QUOTES="'$lmquot'"%' \
  3020.                 | sed 's%^PRODUCT_NAME=""$%PRODUCT_NAME="'"$pkgdesc"'"%' \
  3021.                 | sed 's%^PRODUCT_VERSION=""$%PRODUCT_VERSION="'"$pkgvers"'"%' \
  3022.                 > "$addlicensefname".temp
  3023.                 ${MV} "$addlicensefname".temp "$addlicensefname"
  3024.                 chmod 555 $addlicensefname
  3025.             fi
  3026.  
  3027.             # Copy requestlicense script to ./installscripts and
  3028.             # automatically make changes in place.
  3029.             requestlicensefname="$licensedir/$lmfeat"'.requestlicense'
  3030.             if [ -f "$requestlicensefname" ] ; then
  3031.                 licensefname="$SECURITYFILE"
  3032.                 $CAT "$requestlicensefname" \
  3033.                 | sed 's%^LM_LICENSE_FILE=""$%LM_LICENSE_FILE="'$licensefname'"%' \
  3034.                 | sed 's%^LM_REF_FILE=""$%LM_REF_FILE="'$LM_FILE'"%' \
  3035.                 | sed 's%^LM_DAEMON_DIR=""$%LM_DAEMON_DIR="'$DAEMONDIR'"%' \
  3036.                 | sed 's%^LM_FEATURE=""$%LM_FEATURE="'$lmfeat'"%' \
  3037.                 | sed 's%^LM_VERSION=""$%LM_VERSION="'$lmvers'"%' \
  3038.                 | sed 's%^LM_QUOTES=""$%LM_QUOTES="'$lmquot'"%' \
  3039.                 | sed 's%^PRODUCT_NAME=""$%PRODUCT_NAME="'"$pkgdesc"'"%' \
  3040.                 | sed 's%^PRODUCT_VERSION=""$%PRODUCT_VERSION="'"$pkgvers"'"%' \
  3041.                 > "$requestlicensefname".temp
  3042.                 ${MV} "$requestlicensefname".temp "$requestlicensefname"
  3043.                 chmod 555 $requestlicensefname
  3044.             fi
  3045.             num=`expr $num + 1`
  3046.         done
  3047.     fi
  3048.  
  3049.     # Write out PSRES_PATH to PSRES_FILE, if necessary.
  3050.     psres_writefile=`eval echo '$PKG_'$package_num'_PSRES_WRITEFILE'`
  3051.     if [ "$psres_writefile" = "" ] ; then
  3052.         psres_writefile="$PSRES_WRITEFILE"
  3053.     fi
  3054.     if [ "$psres_writefile" = "y" ] ; then
  3055.         abspath=`expr $PSRES_FILE : '^/'`
  3056.         if [ $abspath = 1 ] ; then
  3057.             psres_file="$PSRES_FILE"
  3058.         else
  3059.             psres_file=${fulldir}'/'"$PSRES_FILE"
  3060.         fi
  3061.         # Determine parent dir for psres_file and make, if necessary.
  3062.         dir=`expr "$psres_file" : '\(.*\)/'`
  3063.         if [ ! -d "$dir" ] ; then
  3064.             $MKDIR $dir
  3065.         fi
  3066.         echo '#
  3067. # This file contains the default path which the application should use for
  3068. # finding its PostScript resources, such as fonts. The format is
  3069. # a single line beginning in column 1 of the form SITE_PSRESOURCEPATH=xxx,
  3070. # where xxx is a list of directories separated by colons.
  3071. # The application might add its own set of directories to this default
  3072. # path - consult the application launch script if you have questions.
  3073. # Users can override the default path by setting environment variable
  3074. # PSRESOURCEPATH to the list of directories to use for PostScript resources.
  3075. # If the user sets PSRESOURCEPATH, he is very much encouraged to include a 
  3076. # double colon (::) in the path (e.g., /usr/lib/dps/fonts::) so that the 
  3077. # application will still find its own default PostScript resources.
  3078.  
  3079. SITE_PSRESOURCEPATH='"$PSRES_PATH" > "$psres_file"
  3080.     fi
  3081.  
  3082.     # Write out LM_FILE with proper value for LM_LICENSE_FILE, if necessary.
  3083.     lm_writefile=`eval echo '$PKG_'$package_num'_LM_WRITEFILE'`
  3084.     if [ "$lm_writefile" = "" ] ; then
  3085.         lm_writefile="$LM_WRITEFILE"
  3086.     fi
  3087.     if [ "$lm_writefile" = "y" ] ; then
  3088.         abspath=`expr $LM_FILE : '^/'`
  3089.         if [ $abspath = 1 ] ; then
  3090.             lm_file="$LM_FILE"
  3091.         else
  3092.             lm_file=${fulldir}'/'"$LM_FILE"
  3093.         fi
  3094.         # Determine parent dir for lm_file and make, if necessary.
  3095.         dir=`expr "$lm_file" : '\(.*\)/'`
  3096.         if [ ! -d "$dir" ] ; then
  3097.             $MKDIR $dir
  3098.         fi
  3099.         echo '#
  3100. # This file contains the path which the application should use for
  3101. # finding its license data file. The format is a single line beginning
  3102. # in column 1 of the form LM_LICENSE_FILE=xxx, where xxx is usually a
  3103. # single file name but can be a list of files separated by colons.
  3104.  
  3105. LM_LICENSE_FILE='"$SECURITYFILE" > "$lm_file"
  3106.     fi
  3107.  
  3108.     # Copy files such as README from CDROM to installation tree, if so requested.
  3109.     cdrom_fromfiles=`eval echo '$PKG_'$package_num'_CDROM_FROMFILES'`
  3110.     if [ "$cdrom_fromfiles" = "" ] ; then
  3111.         # Backwards compatibility. Also accept CDROM_FROMFILE
  3112.         cdrom_fromfiles=`eval echo '$PKG_'$package_num'_CDROM_FROMFILE'`
  3113.     fi
  3114.     cdrom_tofiles=`eval echo '$PKG_'$package_num'_CDROM_TOFILES'`
  3115.     if [ "$cdrom_tofiles" = "" ] ; then
  3116.         # Backwards compatibility. Also accept CDROM_TOFILE
  3117.         cdrom_tofiles=`eval echo '$PKG_'$package_num'_CDROM_TOFILE'`
  3118.     fi
  3119.     ntokens_from=`echo $cdrom_fromfiles | wc -w`
  3120.     ntokens_to=`echo $cdrom_tofiles | wc -w`
  3121.     if [ $ntokens_from -eq $ntokens_to -a $ntokens_from -gt 0 ] ; then
  3122.         i=1
  3123.         for fromfile in $cdrom_fromfiles ; do
  3124.             eval fromfile_$i=$fromfile
  3125.             i=`expr $i + 1`
  3126.         done
  3127.         i=1
  3128.         for tofile in $cdrom_tofiles ; do
  3129.             eval tofile_$i=$tofile
  3130.             i=`expr $i + 1`
  3131.         done
  3132.         i=1
  3133.         while [ $i -le $ntokens_from ] ; do
  3134.             eval fromfile=\$fromfile_$i
  3135.             eval tofile=\$tofile_$i
  3136.             if [ "$fromfile" != "" -a -f "$CDDIR/$fromfile" ] ; then
  3137.                 $RM "$fulldir/$tofile"
  3138.                 $CP -p "$CDDIR/$fromfile" "$fulldir/$tofile"
  3139.             fi
  3140.             i=`expr $i + 1`
  3141.         done
  3142.     fi
  3143.  
  3144.     # Run the post-installation scripts, if present
  3145.     script=`eval echo '$PKG_'$package_num'_SCRIPT'`
  3146.     ntokens=`echo $script | wc -w`
  3147.     if [ $ntokens -gt 0 ] ; then
  3148.         script=$fulldir"/"$script
  3149.         if [ ! -f "$script" ] ; then
  3150.             echo ""
  3151.             echo "Install script error:"
  3152.             echo "Cannot find post-install script $script."
  3153.             eval "${RM} ${FILELIST}"
  3154.             eval ${ABORTCMD}
  3155.         fi
  3156.         if [ ! -x "$script" ] ; then
  3157.             echo ""
  3158.             echo "Install script error:"
  3159.             echo "Cannot execute post-install script $script."
  3160.             eval "${RM} ${FILELIST}"
  3161.             eval ${ABORTCMD}
  3162.         fi
  3163.         if $script $fulldir $SECURITYFILE ; then error=0; else error=1; fi
  3164.         if [ $error != 0  ] ; then
  3165.             echo "Post installation script returned an unexpected error code!"
  3166.             eval "${RM} ${FILELIST}"
  3167.             eval ${ABORTCMD}
  3168.         fi
  3169.     fi
  3170.  
  3171.     # Check for Motif keysyms
  3172.     xkeysymdb=`eval echo '$PKG_'$package_num'_XKEYSYMDB'`
  3173.     if [ "$xkeysymdb" = 1 ] ; then
  3174.         # Write out XKeysymDB file.
  3175.         if [ ! -d ${fulldir}/${XKEYSYMDBDIR} ] ; then
  3176.             $MKDIR ${fulldir}/${XKEYSYMDBDIR}
  3177.         fi
  3178.         fixfile=${fulldir}/${XKEYSYMDBDIR}/${XKEYSYMDBFILE}
  3179.         if [ -r ${fixfile} -a ! -w ${fixfile}  ] ; then
  3180.             echo ""
  3181.             echo "${fixfile} already exists and this script cannot overwrite."
  3182.         else
  3183.             ${RM} ${fixfile}
  3184.             echo '!' > ${fixfile}
  3185.             echo '!        OSF Keysyms' >> ${fixfile}
  3186.             echo '!' >> ${fixfile}
  3187.             echo 'osfBackSpace            :1004FF08' >> ${fixfile}
  3188.             echo 'osfInsert            :1004FF63' >> ${fixfile}
  3189.             echo 'osfDelete            :1004FFFF' >> ${fixfile}
  3190.             echo 'osfCopy                :1004FF02' >> ${fixfile}
  3191.             echo 'osfCut                :1004FF03' >> ${fixfile}
  3192.             echo 'osfPaste            :1004FF04' >> ${fixfile}
  3193.             echo '' >> ${fixfile}
  3194.             echo 'osfAddMode            :1004FF31' >> ${fixfile}
  3195.             echo 'osfPrimaryPaste            :1004FF32' >> ${fixfile}
  3196.             echo 'osfQuickPaste            :1004FF33' >> ${fixfile}
  3197.             echo '' >> ${fixfile}
  3198.             echo 'osfPageUp            :1004FF41' >> ${fixfile}
  3199.             echo 'osfPageDown            :1004FF42' >> ${fixfile}
  3200.             echo '' >> ${fixfile}
  3201.             echo 'osfEndLine            :1004FF57' >> ${fixfile}
  3202.             echo 'osfBeginLine            :1004FF58' >> ${fixfile}
  3203.             echo '' >> ${fixfile}
  3204.             echo 'osfActivate            :1004FF44' >> ${fixfile}
  3205.             echo '' >> ${fixfile}
  3206.             echo 'osfMenuBar            :1004FF45' >> ${fixfile}
  3207.             echo '' >> ${fixfile}
  3208.             echo 'osfClear            :1004FF0B' >> ${fixfile}
  3209.             echo 'osfCancel            :1004FF69' >> ${fixfile}
  3210.             echo 'osfHelp                :1004FF6A' >> ${fixfile}
  3211.             echo 'osfMenu                :1004FF67' >> ${fixfile}
  3212.             echo 'osfSelect            :1004FF60' >> ${fixfile}
  3213.             echo 'osfUndo                :1004FF65' >> ${fixfile}
  3214.             echo '' >> ${fixfile}
  3215.             echo 'osfLeft                :1004FF51' >> ${fixfile}
  3216.             echo 'osfUp                :1004FF52' >> ${fixfile}
  3217.             echo 'osfRight            :1004FF53' >> ${fixfile}
  3218.             echo 'osfDown                :1004FF54' >> ${fixfile}
  3219.         fi
  3220.  
  3221.         if [ "$ALREADY_XKEYSYMDB" != 1 ] ; then
  3222.             # check if XKeysymDB file contains osf bindings. If it doesn't then
  3223.             # append them to /usr/openwin/lib/XKeysymDB file. On many systems
  3224.             # XKeysymDB file contains keysym like osfXK_. These are wrong so
  3225.             # just ignore them
  3226.  
  3227.             if grepout=`grep -v '^osfXK' "$KEYSYMDBFILE" | grep '^osf'` ; then status=0; else status=1; fi
  3228.             if [ $status != 0 ] ; then
  3229.                 echo ""
  3230.                 echo "It seems that your $KEYSYMDBFILE does not contain"
  3231.                 echo "OSF keysyms."
  3232.                 # The next line is equiv to csh: set dirpath=$KEYSYMDBFILE:h
  3233.                 dirpath=`expr $KEYSYMDBFILE : '\(.*\)/' \| $KEYSYMDBFILE`
  3234.                 if [ ! -w $KEYSYMDBFILE -o ! -w $dirpath  ] ; then
  3235.                     echo "This script does not have permission to automatically alter $KEYSYMDBFILE."
  3236.                     echo "In case you see messages complaining about unknown OSF keysyms"
  3237.                     echo "at program startup, then append file ${fixfile}"
  3238.                     echo "to the end of $KEYSYMDBFILE."
  3239.                 else
  3240.                     echo "Appending additional keysyms to $KEYSYMDBFILE."
  3241.                     echo "Old $KEYSYMDBFILE file will be saved in ${KEYSYMDBFILE}.org"
  3242.                     $RM ${KEYSYMDBFILE}.org
  3243.                     $MV $KEYSYMDBFILE ${KEYSYMDBFILE}.org
  3244.                     $CAT ${KEYSYMDBFILE}.org ${fixfile} > $KEYSYMDBFILE
  3245.                 fi
  3246.             else
  3247.                 echo ""
  3248.                 echo "It is good that you have OSF keysyms in $KEYSYMDBFILE."
  3249.                 echo "In case you see messages complaining about unknown OSF keysyms"
  3250.                 echo "at program startup, then append ${fixfile}"
  3251.                 echo "to the end of $KEYSYMDBFILE"
  3252.             fi
  3253.             ALREADY_XKEYSYMDB=1
  3254.         fi
  3255.     fi
  3256. done
  3257.  
  3258. echo ""
  3259. echo ""
  3260. lnks=`expr $ANYSYMLINKS + $ANYFONTLINKS`
  3261. if [ "$AUTOSYMLINK" = "makescript" -a $lnks -ge 1 ] ; then
  3262.     echo "*** To complete installation, follow the remaining instructions ***"
  3263.     echo "*** in the Getting Started Guide for this product. ***"
  3264. else
  3265.     echo "*** Installation complete ***"
  3266. fi
  3267. echo ""
  3268.  
  3269. # Notify user that license keys are needed.
  3270. if [ $ALLOK1 = 1 -a $ANYSECURED = 1 ] ; then
  3271.     echo ""
  3272.     echo "You will need license activation keys for the following applications:"
  3273.     echo ""
  3274.     LMFEATURELIST=""
  3275.     for package_num in ${PKGS_TO_INSTALL_TOTAL} ; do
  3276.         lmfeat=`eval echo '$PKG_'$package_num'_LMFEATURE'`
  3277.         ntokens=`echo $lmfeat | wc -w`
  3278.         if [ $ntokens -gt 0 ] ; then
  3279.             already_lmfeat=`echo $LMFEATURELIST | grep '^'"$lmfeat"'$'`
  3280.             # Skip this if this feature has already been processed.
  3281.             if [ "$already_lmfeat" != "" ] ; then
  3282.                 break
  3283.             fi
  3284.             LMFEATURELIST=$LMFEATURELIST$lmfeat'
  3285. '
  3286.             echo "        "$lmfeat
  3287.         fi
  3288.     done
  3289.     echo ""
  3290.     echo "Refer to the Getting Started guide for information on how to"
  3291.     echo "obtain and install your license activation keys."
  3292.     echo ""
  3293.         echo "Do you want to run the demo version now (y/n)?  \c"
  3294.         read ans
  3295. fi
  3296.  
  3297. if [ $ans = 'y' -o $ans = 'Y' -o $ans = 'yes' -o $ans = 'Yes' ]; then
  3298.     cd $HOME
  3299.     su $USERNAME -c '/usr/bin/illustrator'
  3300. else
  3301.     echo "To launch the demo version at a later time,"
  3302.     echo "enter; illustrator from a command line."
  3303.     echo "...exiting."
  3304.     sleep 3
  3305. fi
  3306.  
  3307.  
  3308. ${RM} $PKGLISTFILE
  3309. exit 0
  3310.  
  3311.